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);
113 std::cout <<
"===========" << iEvent.
id() << std::endl;
115 map<EcalTrigTowerDetId, towerEner> mapTower;
116 map<EcalTrigTowerDetId, towerEner>::iterator itTT;
122 treeVariables_.runNb = iEvent.
id().
run();
123 treeVariables_.evtNb = iEvent.
id().
event();
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++;
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();
203 itTT = mapTower.find(towid);
204 if (itTT != mapTower.end())
205 (itTT->second).nbXtal_++;
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_;
T getParameter(std::string const &) const
EventNumber_t event() const
std::ostream & print_(std::ostream &os, value_type const &hash)
int bunchCrossing() const
~EcalTPGAnalyzer() override
int ieta() const
get the tower ieta
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
std::vector< bool > DecisionWord
typedefs
void analyze(edm::Event const &, edm::EventSetup const &) override
void beginRun(edm::Run const &, edm::EventSetup const &) override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const DecisionWord & decisionWord(int bxInEventValue) const
int iphi() const
get the tower iphi
const EcalTrigTowerDetId & id() const
T const * product() const
T const * product() const
EcalTPGAnalyzer(const edm::ParameterSet &)