ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/src/ClusterAnalyzer.cc
Revision: 1.3
Committed: Mon Dec 1 15:58:05 2008 UTC (16 years, 5 months ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: pat_2_2_5_01, pat_2_1_12_02, pat_2_1_12_01
Changes since 1.2: +1 -1 lines
Log Message:
Proto-version for use with different data formats (RECO/AOD/PAT/PAT+AOD)
Replace the absolute path /UserCode/Morgan with a relative one

File Contents

# User Rev Content
1 lethuill 1.3 #include "../interface/ClusterAnalyzer.h"
2 mlethuil 1.1
3     using namespace std;
4     using namespace reco;
5     using namespace edm;
6    
7     ClusterAnalyzer::ClusterAnalyzer():verbosity(0),iClus(0)
8     {
9     }
10     ClusterAnalyzer::~ClusterAnalyzer()
11     {
12     }
13    
14 lethuill 1.2 void ClusterAnalyzer::Process(const edm::Event& iEvent, TRootEvent* rootEvent, EcalClusterLazyTools& lazyTools, TClonesArray* rootClusters, const string moduleLabel, const string instanceName, const int clusterType)
15 mlethuil 1.1 {
16    
17     edm::Handle<reco::BasicClusterCollection> basicClustersHandle;
18     iEvent.getByLabel(moduleLabel, instanceName, basicClustersHandle);
19     const reco::BasicClusterCollection basicClusters = *(basicClustersHandle.product());
20    
21 lethuill 1.2 if(verbosity>1) cout << endl << " Producer: " << moduleLabel << " : " << instanceName << " - Number of BasicClusters (type " << clusterType << ") = " << basicClusters.size() << std::endl;
22 mlethuil 1.1
23     Int_t iClusType=0;
24    
25     for( reco::BasicClusterCollection::const_iterator aClus = basicClusters.begin(); aClus != basicClusters.end(); aClus++)
26     {
27     TRootCluster localClus( aClus->energy(), aClus->eta(), aClus->phi(), aClus->x(), aClus->y(), aClus->z(), clusterType);
28 lethuill 1.2 localClus.setE3x3( lazyTools.e3x3(*aClus) );
29     localClus.setE5x5( lazyTools.e5x5(*aClus) );
30     localClus.setEmax( lazyTools.eMax(*aClus) );
31     localClus.setE2nd( lazyTools.e2nd(*aClus) );
32 mlethuil 1.1 localClus.setNxtals( (aClus->getHitsByDetId()).size() );
33     localClus.setUid( (aClus->getHitsByDetId())[0] );
34    
35     new( (*rootClusters)[iClus] ) TRootCluster(localClus);
36 lethuill 1.2 if(verbosity>3) cout << " ["<< setw(3) << iClus << "] " << localClus << endl;
37 mlethuil 1.1
38     iClus++;
39     iClusType++;
40     }
41     rootEvent->setNBasicClusters(clusterType,iClusType);
42     }