57 gtRecordCollectionTag_ = iConfig.
getParameter<std::string>(
"GTRecordCollection") ;
59 allowTP_ = iConfig.
getParameter<
bool>(
"ReadTriggerPrimitives");
64 file_ =
new TFile(
"ECALTPGtree.root",
"RECREATE");
68 tree_ =
new TTree(
"EcalTPGAnalysis",
"EcalTPGAnalysis" );
70 tree_->Branch(
"runNb",&treeVariables_.runNb,
"runNb/i");
71 tree_->Branch(
"evtNb",&treeVariables_.evtNb,
"evtNb/i");
72 tree_->Branch(
"bxNb",&treeVariables_.bxNb,
"bxNb/i");
73 tree_->Branch(
"orbitNb",&treeVariables_.orbitNb,
"orbitNb/i");
74 tree_->Branch(
"nbOfActiveTriggers",&treeVariables_.nbOfActiveTriggers,
"nbOfActiveTriggers/i");
75 tree_->Branch(
"activeTriggers",treeVariables_.activeTriggers,
"activeTriggers[nbOfActiveTriggers]/I");
77 tree_->Branch(
"nbOfTowers",&treeVariables_.nbOfTowers,
"nbOfTowers/i");
78 tree_->Branch(
"ieta", treeVariables_.ieta,
"ieta[nbOfTowers]/I");
79 tree_->Branch(
"iphi", treeVariables_.iphi,
"iphi[nbOfTowers]/I");
80 tree_->Branch(
"nbOfXtals", treeVariables_.nbOfXtals,
"nbOfXtals[nbOfTowers]/I");
81 tree_->Branch(
"rawTPData", treeVariables_.rawTPData,
"rawTPData[nbOfTowers]/I");
82 tree_->Branch(
"rawTPEmul1", treeVariables_.rawTPEmul1,
"rawTPEmul1[nbOfTowers]/I");
83 tree_->Branch(
"rawTPEmul2", treeVariables_.rawTPEmul2,
"rawTPEmul2[nbOfTowers]/I");
84 tree_->Branch(
"rawTPEmul3", treeVariables_.rawTPEmul3,
"rawTPEmul3[nbOfTowers]/I");
85 tree_->Branch(
"rawTPEmul4", treeVariables_.rawTPEmul4,
"rawTPEmul4[nbOfTowers]/I");
86 tree_->Branch(
"rawTPEmul5", treeVariables_.rawTPEmul5,
"rawTPEmul5[nbOfTowers]/I");
87 tree_->Branch(
"eRec", treeVariables_.eRec,
"eRec[nbOfTowers]/F");
109 theEndcapGeometry_ = &(*theEndcapGeometry_handle);
110 theBarrelGeometry_ = &(*theBarrelGeometry_handle);
124 map<EcalTrigTowerDetId, towerEner> mapTower ;
125 map<EcalTrigTowerDetId, towerEner>::iterator itTT ;
133 treeVariables_.runNb = iEvent.
id().
run() ;
134 treeVariables_.evtNb = iEvent.
id().
event() ;
149 std::vector<unsigned int> triggerMaskAlgoTrig = l1GtTmAlgo.product()->gtTriggerMask();
154 treeVariables_.nbOfActiveTriggers = 0 ;
155 for (std::vector<bool>::iterator itBit = dWord.begin(); itBit != dWord.end(); ++itBit) {
157 int maskBit = triggerMaskAlgoTrig[iBit] & (1 << iDaq);
158 if (maskBit) *itBit =
false;
160 treeVariables_.activeTriggers[treeVariables_.nbOfActiveTriggers] = iBit ;
161 treeVariables_.nbOfActiveTriggers++ ;
175 if (
print_)
std::cout<<
"TP collection size="<<tp.product()->size()<<std::endl ;
177 for (
unsigned int i=0;
i<tp.product()->size();
i++) {
184 mapTower[TPtowid] = tE ;
194 iEvent.
getByLabel(tpEmulatorCollection_, tpEmul);
195 if (
print_)
std::cout<<
"TPEmulator collection size="<<tpEmul.product()->size()<<std::endl ;
197 for (
unsigned int i=0;
i<tpEmul.product()->size();
i++) {
200 itTT = mapTower.find(TPtowid) ;
201 if (itTT != mapTower.end())
202 for (
int j=0 ;
j<5 ;
j++) (itTT->second).tpgEmul_[
j] = d[
j].raw() ;
215 for (
unsigned int i=0;
i<digiEB.product()->size();
i++) {
219 itTT = mapTower.find(towid) ;
220 if (itTT != mapTower.end()) (itTT->second).nbXtal_++ ;
227 for (
unsigned int i=0;
i<digiEE.
product()->size();
i++) {
231 itTT = mapTower.find(towid) ;
232 if (itTT != mapTower.end()) (itTT->second).nbXtal_++ ;
250 treeVariables_.nbOfTowers = mapTower.size() ;
252 for (itTT = mapTower.begin() ; itTT != mapTower.end() ; ++itTT) {
253 treeVariables_.
ieta[towerNb] = (itTT->second).ieta_ ;
254 treeVariables_.iphi[towerNb] = (itTT->second).iphi_ ;
255 treeVariables_.nbOfXtals[towerNb] = (itTT->second).nbXtal_ ;
256 treeVariables_.rawTPData[towerNb] = (itTT->second).tpgADC_ ;
257 treeVariables_.rawTPEmul1[towerNb] = (itTT->second).tpgEmul_[0] ;
258 treeVariables_.rawTPEmul2[towerNb] = (itTT->second).tpgEmul_[1] ;
259 treeVariables_.rawTPEmul3[towerNb] = (itTT->second).tpgEmul_[2] ;
260 treeVariables_.rawTPEmul4[towerNb] = (itTT->second).tpgEmul_[3] ;
261 treeVariables_.rawTPEmul5[towerNb] = (itTT->second).tpgEmul_[4] ;
262 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)
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
int bunchCrossing() const
int ieta() const
get the tower ieta
std::vector< bool > DecisionWord
typedefs
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void analyze(edm::Event const &, edm::EventSetup const &)
int iphi() const
get the tower iphi
const EcalTrigTowerDetId & id() const
T const * product() const
EcalTPGAnalyzer(const edm::ParameterSet &)