#include <src/L1RCTTestAnalyzer/src/L1RCTTestAnalyzer.cc>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
L1RCTTestAnalyzer (const edm::ParameterSet &) | |
~L1RCTTestAnalyzer () | |
Private Attributes | |
edm::InputTag | ecalDigisLabel |
TH1F * | h_ecalTimeSample |
TH1F * | h_emCandTimeSample |
TH1F * | h_emIeta |
TH1F * | h_emIphi |
TH1F * | h_emIso |
TH2F * | h_emIsoInIetaIphi |
TH2F * | h_emNonIsoInIetaIphi |
TH1F * | h_emRank |
TH2F * | h_emRankInIetaIphi |
TH1F * | h_emRankOutOfTime |
TH1F * | h_hcalTimeSample |
TH2F * | h_regionFGInIetaIphi |
TH1F * | h_regionIeta |
TH1F * | h_regionIphi |
TH1F * | h_regionMip |
TH1F * | h_regionSum |
TH2F * | h_regionSumInIetaIphi |
TH1F * | h_towerMip |
edm::InputTag | hcalDigisLabel |
std::string | m_HepMCProduct |
edm::InputTag | rctDigisLabel |
bool | showEmCands |
bool | showRegionSums |
Implementation: <Notes on="" implementation>="">
Definition at line 47 of file L1RCTTestAnalyzer.h.
L1RCTTestAnalyzer::L1RCTTestAnalyzer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 27 of file L1RCTTestAnalyzer.cc.
References h_ecalTimeSample, h_emCandTimeSample, h_emIeta, h_emIphi, h_emIso, h_emIsoInIetaIphi, h_emNonIsoInIetaIphi, h_emRank, h_emRankInIetaIphi, h_emRankOutOfTime, h_hcalTimeSample, h_regionFGInIetaIphi, h_regionIeta, h_regionIphi, h_regionMip, h_regionSum, h_regionSumInIetaIphi, and h_towerMip.
00027 : 00028 showEmCands(iConfig.getUntrackedParameter<bool>("showEmCands")), 00029 showRegionSums(iConfig.getUntrackedParameter<bool>("showRegionSums")), 00030 ecalDigisLabel(iConfig.getParameter<edm::InputTag>("ecalDigisLabel")), 00031 hcalDigisLabel(iConfig.getParameter<edm::InputTag>("hcalDigisLabel")), 00032 rctDigisLabel(iConfig.getParameter<edm::InputTag>("rctDigisLabel")) 00033 { 00034 //now do what ever initialization is needed 00035 00036 edm::Service<TFileService> fs; 00037 h_emRank = fs->make<TH1F>( "emRank", "emRank", 64, 0., 64. ); 00038 h_emRankOutOfTime = fs->make<TH1F>( "emRankOutOfTime", "emRankOutOfTime", 00039 64, 0., 64. ); 00040 h_emIeta = fs->make<TH1F>( "emIeta", "emIeta", 22, 0., 22. ); 00041 h_emIphi = fs->make<TH1F>( "emIphi", "emIphi", 18, 0., 18. ); 00042 h_emIso = fs->make<TH1F>( "emIso", "emIso", 2, 0., 2. ); 00043 h_emRankInIetaIphi = fs->make<TH2F>( "emRank2D", "emRank2D", 22, 0., 22., 00044 18, 0., 18. ); 00045 h_emIsoInIetaIphi = fs->make<TH2F>( "emIso2D", "emIso2D", 22, 0., 22., 00046 18, 0., 18. ); 00047 h_emNonIsoInIetaIphi = fs->make<TH2F>( "emNonIso2D", "emNonIso2D", 22, 0., 00048 22., 18, 0., 18. ); 00049 h_emCandTimeSample = fs->make<TH1F>( "emCandTimeSample", "emCandTimeSample", 00050 5, -2., 2.); 00051 00052 h_regionSum = fs->make<TH1F>( "regionSum", "regionSum", 100, 0., 100. ); 00053 h_regionIeta = fs->make<TH1F>( "regionIeta", "regionIeta", 22, 0., 22. ); 00054 h_regionIphi = fs->make<TH1F>( "regionIphi", "regionIphi", 18, 0., 18. ); 00055 h_regionMip = fs->make<TH1F>( "regionMip", "regionMipBit", 2, 0., 2. ); 00056 h_regionSumInIetaIphi = fs->make<TH2F>( "regionSum2D", "regionSum2D", 22, 00057 0., 22., 18, 0., 18. ); 00058 h_regionFGInIetaIphi = fs->make<TH2F>( "regionFG2D", "regionFG2D", 22, 0., 00059 22., 18, 0., 18. ); 00060 00061 h_towerMip = fs->make<TH1F>( "towerMip", "towerMipBit", 2, 0., 2. ); 00062 00063 h_ecalTimeSample = fs->make<TH1F>( "ecalTimeSample", "ecalTimeSample", 00064 10, 0., 10. ); 00065 h_hcalTimeSample = fs->make<TH1F>( "hcalTimeSample", "hcalTimeSample", 00066 10, 0., 10. ); 00067 00068 // get names of modules, producing object collections 00069 }
L1RCTTestAnalyzer::~L1RCTTestAnalyzer | ( | ) |
Definition at line 72 of file L1RCTTestAnalyzer.cc.
00073 { 00074 00075 // do anything here that needs to be done at destruction time 00076 // (e.g. close files, deallocate resources etc.) 00077 00078 }
void L1RCTTestAnalyzer::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 87 of file L1RCTTestAnalyzer.cc.
References GenMuonPlsPt100GeV_cfg::cout, ReconstructionGR_cff::ecal, ecalDigisLabel, em, lat::endl(), edm::EventSetup::get(), edm::Event::getByLabel(), h_ecalTimeSample, h_emCandTimeSample, h_emIeta, h_emIphi, h_emIso, h_emIsoInIetaIphi, h_emNonIsoInIetaIphi, h_emRank, h_emRankInIetaIphi, h_emRankOutOfTime, h_hcalTimeSample, h_regionFGInIetaIphi, h_regionIeta, h_regionIphi, h_regionMip, h_regionSum, h_regionSumInIetaIphi, h_towerMip, ReconstructionGR_cff::hcal, hcalDigisLabel, rctDigisLabel, rgn, showEmCands, and showRegionSums.
00088 { 00089 using namespace edm; 00090 #ifdef THIS_IS_AN_EVENT_EXAMPLE 00091 Handle<ExampleData> pIn; 00092 iEvent.getByLabel("example",pIn); 00093 #endif 00094 00095 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE 00096 ESHandle<SetupData> pSetup; 00097 iSetup.get<SetupRecord>().get(pSetup); 00098 #endif 00099 00100 // as in L1GctTestAnalyzer.cc 00101 Handle<L1CaloEmCollection> rctEmCands; 00102 Handle<L1CaloRegionCollection> rctRegions; 00103 Handle<EcalTrigPrimDigiCollection> ecalColl; 00104 Handle<HcalTrigPrimDigiCollection> hcalColl; 00105 00106 L1CaloEmCollection::const_iterator em; 00107 L1CaloRegionCollection::const_iterator rgn; 00108 EcalTrigPrimDigiCollection::const_iterator ecal; 00109 HcalTrigPrimDigiCollection::const_iterator hcal; 00110 00111 iEvent.getByLabel(rctDigisLabel, rctEmCands); 00112 iEvent.getByLabel(rctDigisLabel, rctRegions); 00113 iEvent.getByLabel(ecalDigisLabel, ecalColl); 00114 iEvent.getByLabel(hcalDigisLabel, hcalColl); 00115 00116 for (ecal=ecalColl->begin(); ecal!=ecalColl->end(); ecal++) 00117 { 00118 for (unsigned short sample = 0; sample < (*ecal).size(); sample++) 00119 { 00120 h_ecalTimeSample->Fill(sample); 00121 } 00122 } 00123 00124 for (hcal=hcalColl->begin(); hcal!=hcalColl->end(); hcal++) 00125 { 00126 h_towerMip->Fill( (*hcal).SOI_fineGrain() ); 00127 for (unsigned short sample = 0; sample < (*hcal).size(); sample++) 00128 { 00129 h_hcalTimeSample->Fill(sample); 00130 } 00131 } 00132 00133 if(showEmCands) 00134 { 00135 cout << endl << "L1 RCT EmCand objects" << endl; 00136 } 00137 for (em=rctEmCands->begin(); em!=rctEmCands->end(); em++){ 00138 // cout << "(Analyzer)\n" << (*em) << endl; 00139 h_emCandTimeSample->Fill((*em).bx()); 00140 if ((*em).bx() == 0) 00141 { 00142 unsigned short n_emcands = 0; 00143 //cout << endl << "rank: " << (*em).rank() ; 00144 00145 if ((*em).rank() > 0) 00146 { 00147 h_emRank->Fill( (*em).rank() ); 00148 h_emIeta->Fill( (*em).regionId().ieta() ); 00149 h_emIphi->Fill( (*em).regionId().iphi() ); 00150 h_emIso->Fill( (*em).isolated() ); 00151 h_emRankInIetaIphi->Fill( (*em).regionId().ieta(), 00152 (*em).regionId().iphi(), 00153 (*em).rank() ); 00154 if ((*em).isolated()) 00155 { 00156 h_emIsoInIetaIphi->Fill( (*em).regionId().ieta(), 00157 (*em).regionId().iphi() ); 00158 } 00159 else 00160 { 00161 h_emNonIsoInIetaIphi->Fill( (*em).regionId().ieta(), 00162 (*em).regionId().iphi() ); 00163 } 00164 } 00165 00166 if (showEmCands) 00167 { 00168 if ((*em).rank() > 0) 00169 { 00170 cout << endl << "rank: " << (*em).rank(); 00171 unsigned short rgnPhi = 999; 00172 unsigned short rgn = (unsigned short) (*em).rctRegion(); 00173 unsigned short card = (unsigned short) (*em).rctCard(); 00174 unsigned short crate = (unsigned short) (*em).rctCrate(); 00175 00176 if (card == 6) 00177 { 00178 rgnPhi = rgn; 00179 } 00180 else if (card < 6) 00181 { 00182 rgnPhi = (card % 2); 00183 } 00184 else 00185 { 00186 cout << "rgnPhi not assigned (still " << rgnPhi << ") -- Weird card number! " << card ; 00187 } 00188 unsigned short phi_bin = ((crate % 9) * 2) + rgnPhi; 00189 short eta_bin = (card/2) * 2 + 1; 00190 if (card < 6) 00191 { 00192 eta_bin = eta_bin + rgn; 00193 } 00194 if (crate < 9) 00195 { 00196 eta_bin = -eta_bin; 00197 } 00198 n_emcands++; 00199 cout << /* "rank: " << (*em).rank() << */ " eta_bin: " << eta_bin << " phi_bin: " << phi_bin << ". crate: " << crate << " card: " << card << " region: " << rgn << ". isolated: " << (*em).isolated(); 00200 } 00201 } 00202 } 00203 else 00204 { 00205 h_emRankOutOfTime->Fill( (*em).rank() ); 00206 } 00207 } 00208 if(showEmCands) 00209 { 00210 cout << endl; 00211 } 00212 00213 if(showRegionSums) 00214 { 00215 cout << "Regions" << endl; 00216 } 00217 for (rgn=rctRegions->begin(); rgn!=rctRegions->end(); rgn++) 00218 { 00219 if ((*rgn).bx() == 0) 00220 { 00221 if(showRegionSums) 00222 { 00223 cout << /* "(Analyzer)\n" << */ (*rgn) << endl; 00224 } 00225 if ( (*rgn).et() > 0 ) 00226 { 00227 h_regionSum->Fill( (*rgn).et() ); 00228 h_regionIeta->Fill( (*rgn).gctEta() ); 00229 h_regionIphi->Fill( (*rgn).gctPhi() ); 00230 h_regionSumInIetaIphi->Fill( (*rgn).gctEta(), (*rgn).gctPhi(), 00231 (*rgn).et() ); 00232 h_regionFGInIetaIphi->Fill( (*rgn).gctEta(), (*rgn).gctPhi(), 00233 (*rgn).fineGrain() ); 00234 } 00235 h_regionMip->Fill( (*rgn).mip() ); 00236 } 00237 } 00238 if(showRegionSums) 00239 { 00240 cout << endl; 00241 } 00242 00243 }
TH1F* L1RCTTestAnalyzer::h_ecalTimeSample [private] |
Definition at line 85 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_emCandTimeSample [private] |
Definition at line 72 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_emIeta [private] |
Definition at line 65 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_emIphi [private] |
Definition at line 66 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_emIso [private] |
Definition at line 67 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH2F* L1RCTTestAnalyzer::h_emIsoInIetaIphi [private] |
Definition at line 70 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH2F* L1RCTTestAnalyzer::h_emNonIsoInIetaIphi [private] |
Definition at line 71 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_emRank [private] |
Definition at line 63 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH2F* L1RCTTestAnalyzer::h_emRankInIetaIphi [private] |
Definition at line 68 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_emRankOutOfTime [private] |
Definition at line 64 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_hcalTimeSample [private] |
Definition at line 86 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH2F* L1RCTTestAnalyzer::h_regionFGInIetaIphi [private] |
Definition at line 81 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_regionIeta [private] |
Definition at line 75 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_regionIphi [private] |
Definition at line 76 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_regionMip [private] |
Definition at line 77 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_regionSum [private] |
Definition at line 74 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH2F* L1RCTTestAnalyzer::h_regionSumInIetaIphi [private] |
Definition at line 78 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
TH1F* L1RCTTestAnalyzer::h_towerMip [private] |
Definition at line 83 of file L1RCTTestAnalyzer.h.
Referenced by analyze(), and L1RCTTestAnalyzer().
std::string L1RCTTestAnalyzer::m_HepMCProduct [private] |
Definition at line 56 of file L1RCTTestAnalyzer.h.
bool L1RCTTestAnalyzer::showEmCands [private] |
bool L1RCTTestAnalyzer::showRegionSums [private] |