57 allowTP_ = iConfig.
getParameter<
bool>(
"ReadTriggerPrimitives");
62 file_ =
new TFile(
"ECALTPGtree.root",
"RECREATE");
66 tree_ =
new TTree(
"EcalTPGAnalysis",
"EcalTPGAnalysis");
68 tree_->Branch(
"runNb", &treeVariables_.runNb,
"runNb/i");
69 tree_->Branch(
"evtNb", &treeVariables_.evtNb,
"evtNb/i");
70 tree_->Branch(
"bxNb", &treeVariables_.bxNb,
"bxNb/i");
71 tree_->Branch(
"orbitNb", &treeVariables_.orbitNb,
"orbitNb/i");
72 tree_->Branch(
"nbOfActiveTriggers", &treeVariables_.nbOfActiveTriggers,
"nbOfActiveTriggers/i");
73 tree_->Branch(
"activeTriggers", treeVariables_.activeTriggers,
"activeTriggers[nbOfActiveTriggers]/I");
75 tree_->Branch(
"nbOfTowers", &treeVariables_.nbOfTowers,
"nbOfTowers/i");
76 tree_->Branch(
"ieta", treeVariables_.ieta,
"ieta[nbOfTowers]/I");
77 tree_->Branch(
"iphi", treeVariables_.iphi,
"iphi[nbOfTowers]/I");
78 tree_->Branch(
"nbOfXtals", treeVariables_.nbOfXtals,
"nbOfXtals[nbOfTowers]/I");
79 tree_->Branch(
"rawTPData", treeVariables_.rawTPData,
"rawTPData[nbOfTowers]/I");
80 tree_->Branch(
"rawTPEmul1", treeVariables_.rawTPEmul1,
"rawTPEmul1[nbOfTowers]/I");
81 tree_->Branch(
"rawTPEmul2", treeVariables_.rawTPEmul2,
"rawTPEmul2[nbOfTowers]/I");
82 tree_->Branch(
"rawTPEmul3", treeVariables_.rawTPEmul3,
"rawTPEmul3[nbOfTowers]/I");
83 tree_->Branch(
"rawTPEmul4", treeVariables_.rawTPEmul4,
"rawTPEmul4[nbOfTowers]/I");
84 tree_->Branch(
"rawTPEmul5", treeVariables_.rawTPEmul5,
"rawTPEmul5[nbOfTowers]/I");
85 tree_->Branch(
"eRec", treeVariables_.eRec,
"eRec[nbOfTowers]/F");
104 theEndcapGeometry_ = &(*theEndcapGeometry_handle);
105 theBarrelGeometry_ = &(*theBarrelGeometry_handle);
115 map<EcalTrigTowerDetId, towerEner> mapTower;
116 map<EcalTrigTowerDetId, towerEner>::iterator itTT;
122 treeVariables_.runNb =
iEvent.id().run();
123 treeVariables_.evtNb =
iEvent.id().event();
124 treeVariables_.bxNb =
iEvent.bunchCrossing();
125 treeVariables_.orbitNb =
iEvent.orbitNumber();
142 treeVariables_.nbOfActiveTriggers = 0;
143 for (std::vector<bool>::iterator itBit = dWord.begin(); itBit != dWord.end(); ++itBit) {
145 int maskBit = triggerMaskAlgoTrig[iBit] & (1 << iDaq);
149 treeVariables_.activeTriggers[treeVariables_.nbOfActiveTriggers] = iBit;
150 treeVariables_.nbOfActiveTriggers++;
159 iEvent.getByLabel(tpCollection_,
tp);
161 std::cout <<
"TP collection size=" <<
tp.product()->size() << std::endl;
163 for (
unsigned int i = 0;
i <
tp.product()->size();
i++) {
170 mapTower[TPtowid] = tE;
178 iEvent.getByLabel(tpEmulatorCollection_, tpEmul);
185 itTT = mapTower.find(TPtowid);
186 if (itTT != mapTower.end())
187 for (
int j = 0;
j < 5;
j++)
188 (itTT->second).tpgEmul_[
j] =
d[
j].raw();
197 iEvent.getByLabel(digiCollectionEB_, digiEB);
203 itTT = mapTower.find(towid);
204 if (itTT != mapTower.end())
205 (itTT->second).nbXtal_++;
211 iEvent.getByLabel(digiCollectionEE_, digiEE);
216 itTT = mapTower.find(towid);
217 if (itTT != mapTower.end())
218 (itTT->second).nbXtal_++;
232 treeVariables_.nbOfTowers = mapTower.size();
234 for (itTT = mapTower.begin(); itTT != mapTower.end(); ++itTT) {
235 treeVariables_.
ieta[towerNb] = (itTT->second).ieta_;
236 treeVariables_.iphi[towerNb] = (itTT->second).iphi_;
237 treeVariables_.nbOfXtals[towerNb] = (itTT->second).nbXtal_;
238 treeVariables_.rawTPData[towerNb] = (itTT->second).tpgADC_;
239 treeVariables_.rawTPEmul1[towerNb] = (itTT->second).tpgEmul_[0];
240 treeVariables_.rawTPEmul2[towerNb] = (itTT->second).tpgEmul_[1];
241 treeVariables_.rawTPEmul3[towerNb] = (itTT->second).tpgEmul_[2];
242 treeVariables_.rawTPEmul4[towerNb] = (itTT->second).tpgEmul_[3];
243 treeVariables_.rawTPEmul5[towerNb] = (itTT->second).tpgEmul_[4];
244 treeVariables_.eRec[towerNb] = (itTT->second).eRec_;