ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/ForwardAnalysis/Utilities/src/CastorEnergy.cc
Revision: 1.1
Committed: Mon Aug 29 16:39:31 2011 UTC (13 years, 8 months ago) by antoniov
Content type: text/plain
Branch: MAIN
CVS Tags: V01-01-01, V01-01-00, antoniov-forwardAnalysis-09Jul2012-v1, antoniov-forwardAnalysis-29Jun2012-v1, V01-00-00, antoniov-utilities-11Jun2012-v1, antoniov-forwardAnalysis-Oct072011-v1, sfonseca_10_04_2011, antoniov-forwardAnalysis-Sep182011-v1, antoniov-forwardAnalysis-Sep102011-v1, HEAD
Log Message:
adding CastorEnergy utility class

File Contents

# User Rev Content
1 antoniov 1.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     }