ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/src/PhotonAnalyzer.cc
(Generate patch)

Comparing UserCode/Morgan/src/PhotonAnalyzer.cc (file contents):
Revision 1.4 by lethuill, Wed Nov 19 19:03:16 2008 UTC vs.
Revision 1.7 by lethuill, Wed Dec 17 16:23:49 2008 UTC

# Line 1 | Line 1
1 < #include "UserCode/Morgan/interface/PhotonAnalyzer.h"
1 > #include "../interface/PhotonAnalyzer.h"
2  
3   using namespace std;
4   using namespace reco;
5   using namespace edm;
6  
7 < PhotonAnalyzer::PhotonAnalyzer(const edm::ParameterSet& producersNames):verbosity_(0), iconvtrack_(0), doPhotonConversion_(true), doVertexCorrection_(true)
7 > PhotonAnalyzer::PhotonAnalyzer(const edm::ParameterSet& producersNames):verbosity_(0), iconvtrack_(0), doPhotonConversion_(true), doVertexCorrection_(true),useMC_(false)
8   {
9          photonIDProducer_ = producersNames.getParameter<edm::InputTag>("photonIDProducer");
10   }
11  
12 < PhotonAnalyzer::PhotonAnalyzer(const edm::ParameterSet& producersNames, int verbosity, bool doPhotonConversion, bool doVertexCorrection):verbosity_(verbosity), iconvtrack_(0), doPhotonConversion_(doPhotonConversion), doVertexCorrection_(doVertexCorrection)
12 > PhotonAnalyzer::PhotonAnalyzer(const edm::ParameterSet& producersNames, const edm::ParameterSet& myConfig, int verbosity, bool doPhotonConversion, bool doVertexCorrection):verbosity_(verbosity), iconvtrack_(0), doPhotonConversion_(doPhotonConversion), doVertexCorrection_(doVertexCorrection)
13   {
14 +        dataType_ = producersNames.getUntrackedParameter<string>("dataType","unknown");
15          photonIDProducer_ = producersNames.getParameter<edm::InputTag>("photonIDProducer");
16   }
17  
# Line 213 | Line 214 | void PhotonAnalyzer::Process(const edm::
214                                  cout << "  PhotonAnalyzer - NO PRIMARY VERTEX FOUND !!!" << endl;
215                          }
216                  }
217 +
218 +                /*if(useMC_)
219 +                {      
220 +                if( dataType_=="PAT" || dataType_=="PATAOD" )  
221 +                // MC truth associator index
222 +                  if ((photon.genParticleRef()).isNonnull()) {
223 +                     localPhoton.setGenParticleIndex((photon.genParticleRef()).index());
224 +                  } else {
225 +                     localPhoton.setGenParticleIndex(-1);
226 +                  }
227 +                  if ( photon->genParticle() != NULL ) {
228 +                    localPhoton.setMomentumMCPhoton(photon->genParticle()->px(),photon->genParticle()->py(),photon->genParticle()->pz(),photon->genParticle()->energy());
229 +                    localPhoton.setVertexMCPhoton(TVector3(photon->genParticle()->vx(),photon->genParticle()->vy(),photon->genParticle()->vz()));
230 +                    localPhoton.setPdgIdMCPhoton(photon->genParticle()->pdgId());
231 +                  }              
232 +                }
233 +                }*/
234                  
235                  // Stock new TRootPhoton in TCloneArray
236                  new( (*rootPhotons)[iPhoton] ) TRootPhoton(localPhoton);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines