Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:59

0001 #include "TEveJetCone.h"
0002 #include "DataFormats/JetReco/interface/Jet.h"
0003 #include "Fireworks/Core/interface/Context.h"
0004 
0005 namespace fireworks {
0006   TEveJetCone* makeEveJetCone(const reco::Jet& iData, const fireworks::Context& context) {
0007     TEveJetCone* jet = new TEveJetCone();
0008     jet->SetApex(TEveVector(iData.vertex().x(), iData.vertex().y(), iData.vertex().z()));
0009 
0010     reco::Jet::Constituents c = iData.getJetConstituents();
0011     bool haveData = true;
0012     for (reco::Jet::Constituents::const_iterator itr = c.begin(); itr != c.end(); ++itr) {
0013       if (!itr->isAvailable()) {
0014         haveData = false;
0015         break;
0016       }
0017     }
0018 
0019     double eta_size = 0.2;
0020     double phi_size = 0.2;
0021     if (haveData) {
0022       eta_size = sqrt(iData.etaetaMoment());
0023       phi_size = sqrt(iData.phiphiMoment());
0024     }
0025 
0026     static const float offr = 5;
0027     static const float offz = offr / tan(context.caloTransAngle());
0028     if (iData.eta() < context.caloMaxEta())
0029       jet->SetCylinder(context.caloR1(false) - offr, context.caloZ1(false) - offz);
0030     else
0031       jet->SetCylinder(context.caloR2(false) - offr, context.caloZ2(false) - offz);
0032 
0033     jet->AddEllipticCone(iData.eta(), iData.phi(), eta_size, phi_size);
0034     jet->SetPickable(kTRUE);
0035     return jet;
0036   }
0037 }  // namespace fireworks