1 |
|
2 |
#include "ForwardAnalysis/Utilities/interface/CastorEnergy.h"
|
3 |
|
4 |
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
|
5 |
|
6 |
using forwardAnalysis::CastorEnergy;
|
7 |
|
8 |
double CastorEnergy::operator()(CastorRecHitCollection const& castorRecHitCollection, bool isRealData){
|
9 |
|
10 |
double sumETotCastor = 0.;
|
11 |
|
12 |
// Loop over rec hits
|
13 |
CastorRecHitCollection::const_iterator castorRecHit = castorRecHitCollection.begin();
|
14 |
CastorRecHitCollection::const_iterator castorRecHits_end = castorRecHitCollection.end();
|
15 |
for(; castorRecHit != castorRecHits_end; ++castorRecHit) {
|
16 |
const CastorRecHit& recHit = (*castorRecHit);
|
17 |
|
18 |
int sectorId = recHit.id().sector();
|
19 |
int moduleId = recHit.id().module();
|
20 |
double energy = recHit.energy();
|
21 |
//double time = recHit.time();
|
22 |
|
23 |
if( !isRealData ) energy *= 62.5;
|
24 |
|
25 |
// Apply thresholds on rec. hits, etc.
|
26 |
// ...
|
27 |
|
28 |
// Use only selected subset of modules
|
29 |
//if( moduleId > 5 ) continue;
|
30 |
if( std::find(modules_.begin(),modules_.end(),moduleId) == modules_.end() ) continue;
|
31 |
|
32 |
// Reject known bad detector areas
|
33 |
if( moduleId == 1 && sectorId == 5 ) continue;
|
34 |
if( moduleId == 1 && sectorId == 6 ) continue;
|
35 |
|
36 |
sumETotCastor += energy;
|
37 |
}
|
38 |
|
39 |
return sumETotCastor;
|
40 |
}
|