69 |
|
|
70 |
|
using namespace std; |
71 |
|
|
72 |
< |
#define MAXHITS 1000000 |
72 |
> |
#define MAXHITS 100000 |
73 |
|
|
74 |
|
struct MyRecHit{ |
75 |
|
int depth[MAXHITS]; |
76 |
|
int n; |
77 |
|
|
78 |
+ |
int ieta[MAXHITS]; |
79 |
+ |
int iphi[MAXHITS]; |
80 |
+ |
|
81 |
|
float e[MAXHITS]; |
82 |
|
float et[MAXHITS]; |
83 |
|
float eta[MAXHITS]; |
162 |
|
MyRecHit eeRecHit; |
163 |
|
MyRecHit myBC; |
164 |
|
MyRecHit myTowers; |
165 |
+ |
MyRecHit castorRecHit; |
166 |
+ |
|
167 |
|
MyBkg bkg; |
168 |
|
|
169 |
|
TNtuple* nt; |
174 |
|
TTree* bcTree; |
175 |
|
TTree* towerTree; |
176 |
|
TTree* bkgTree; |
177 |
+ |
TTree* castorTree; |
178 |
|
|
179 |
|
double cone; |
180 |
|
double hfTowerThreshold_; |
212 |
|
bool doEcal_; |
213 |
|
bool doHcal_; |
214 |
|
bool doHF_; |
215 |
+ |
bool doCastor_; |
216 |
+ |
|
217 |
|
bool hasVtx_; |
218 |
|
bool saveBothVtx_; |
219 |
|
|
254 |
|
doEcal_ = iConfig.getUntrackedParameter<bool>("doEcal",true); |
255 |
|
doHcal_ = iConfig.getUntrackedParameter<bool>("doHcal",true); |
256 |
|
doHF_ = iConfig.getUntrackedParameter<bool>("doHF",true); |
257 |
+ |
doCastor_ = iConfig.getUntrackedParameter<bool>("doCASTOR",true); |
258 |
+ |
|
259 |
|
hasVtx_ = iConfig.getUntrackedParameter<bool>("hasVtx",true); |
260 |
|
saveBothVtx_ = iConfig.getUntrackedParameter<bool>("saveBothVtx",false); |
261 |
|
|
576 |
|
} |
577 |
|
} |
578 |
|
|
579 |
+ |
if(doCastor_){ |
580 |
+ |
|
581 |
+ |
edm::Handle<CastorRecHitCollection> casrechits; |
582 |
+ |
try{ ev.getByLabel("castorreco",casrechits); } |
583 |
+ |
catch(...) { edm::LogWarning(" CASTOR ") << " Cannot get Castor RecHits " << std::endl; } |
584 |
+ |
|
585 |
+ |
int nhits = 0; |
586 |
+ |
double energyCastor = 0; |
587 |
+ |
|
588 |
+ |
if(casrechits.failedToGet()!=0 || !casrechits.isValid()) { |
589 |
+ |
edm::LogWarning(" CASTOR ") << " Cannot read CastorRecHitCollection" << std::endl; |
590 |
+ |
} else { |
591 |
+ |
for(size_t i1 = 0; i1 < casrechits->size(); ++i1) { |
592 |
+ |
const CastorRecHit & rh = (*casrechits)[i1]; |
593 |
+ |
HcalCastorDetId castorid = rh.id(); |
594 |
+ |
energyCastor += rh.energy(); |
595 |
+ |
if (nhits < 224) { |
596 |
+ |
castorRecHit.e[nhits] = rh.energy(); |
597 |
+ |
castorRecHit.iphi[nhits] = castorid.sector(); |
598 |
+ |
castorRecHit.depth[nhits] = castorid.module(); |
599 |
+ |
castorRecHit.phi[nhits] = getPhi(castorid); |
600 |
+ |
} |
601 |
+ |
|
602 |
+ |
nhits++; |
603 |
+ |
|
604 |
+ |
} // end loop castor rechits |
605 |
+ |
} |
606 |
+ |
|
607 |
+ |
castorRecHit.n = nhits; |
608 |
+ |
castorTree->Fill(); |
609 |
+ |
} |
610 |
+ |
|
611 |
+ |
|
612 |
|
if(!doEbyEonly_){ |
613 |
|
towerTree->Fill(); |
614 |
|
|
684 |
|
towerTree->Branch("emEt",myTowers.emEt,"emEt[n]/F"); |
685 |
|
towerTree->Branch("hadEt",myTowers.hadEt,"hadEt[n]/F"); |
686 |
|
|
687 |
+ |
|
688 |
+ |
if(doCastor_){ |
689 |
+ |
castorTree = fs->make<TTree>("castor",versionTag); |
690 |
+ |
castorTree->Branch("n",&castorRecHit.n,"n/I"); |
691 |
+ |
castorTree->Branch("e",castorRecHit.e,"e[n]/F"); |
692 |
+ |
castorTree->Branch("iphi",castorRecHit.iphi,"iphi[n]/I"); |
693 |
+ |
castorTree->Branch("phi",castorRecHit.phi,"phi[n]/F"); |
694 |
+ |
castorTree->Branch("depth",castorRecHit.depth,"depth[n]/I"); |
695 |
+ |
} |
696 |
+ |
|
697 |
|
if (saveBothVtx_) { |
698 |
|
towerTree->Branch("etVtx",myTowers.etVtx,"etvtx[n]/F"); |
699 |
|
towerTree->Branch("etaVtx",myTowers.etaVtx,"etavtx[n]/F"); |