CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Public Attributes
PFRootEventManagerColin Class Reference

#include <PFRootEventManagerColin.h>

Inheritance diagram for PFRootEventManagerColin:
PFRootEventManager

Public Types

enum  Mode { Neutral =0, HIGH_E_TAUS =1 }
 
- Public Types inherited from PFRootEventManager
typedef std::map< int, int > EventToEntry
 
typedef std::map< int,
EventToEntry
LumisMap
 
typedef std::map< int, LumisMapRunsMap
 
enum  Verbosity { SHUTUP = 0, VERBOSE }
 
enum  View_t {
  XY = 0, RZ = 1, EPE = 2, EPH = 3,
  NViews = 4
}
 viewport definition More...
 

Public Member Functions

 PFRootEventManagerColin (const char *file)
 
bool processEntry (int entry)
 process one entry (pass the TTree entry) More...
 
bool processHIGH_E_TAUS ()
 
bool processNeutral ()
 
void readSpecificOptions (const char *file)
 
void write ()
 
 ~PFRootEventManagerColin ()
 
- Public Member Functions inherited from PFRootEventManager
const reco::PFBlockCollectionblocks () const
 
int chargeValue (const int &pdgId) const
 
const reco::PFSimParticleclosestParticle (reco::PFTrajectoryPoint::LayerType layer, double eta, double phi, double &peta, double &pphi, double &pe) const
 find the closest PFSimParticle to a point (eta,phi) in a given detector More...
 
void clustering ()
 read data from testbeam tree More...
 
void connect (const char *infilename="")
 open the root file and connect to the tree More...
 
bool countChargedAndPhotons () const
 
bool eventAccepted () const
 returns true if the event is accepted(have a look at the function implementation) More...
 
int eventNumber ()
 
int eventToEntry (int run, int lumi, int event) const
 
std::string expand (const std::string &oldString) const
 
void fillClusterMask (std::vector< bool > &mask, const reco::PFClusterCollection &clusters) const
 cluster mask set to true for rechits inside TCutG More...
 
void fillOutEventWithBlocks (const reco::PFBlockCollection &blocks)
 fills outEvent with blocks More...
 
void fillOutEventWithCaloTowers (const CaloTowerCollection &cts)
 fills outEvent with calo towers More...
 
void fillOutEventWithClusters (const reco::PFClusterCollection &clusters)
 fills OutEvent with clusters More...
 
void fillOutEventWithPFCandidates (const reco::PFCandidateCollection &pfCandidates)
 fills OutEvent with candidates More...
 
void fillOutEventWithSimParticles (const reco::PFSimParticleCollection &ptcs)
 fills OutEvent with sim particles More...
 
void fillRecHitMask (std::vector< bool > &mask, const reco::PFRecHitCollection &rechits) const
 rechit mask set to true for rechits inside TCutG More...
 
void fillTrackMask (std::vector< bool > &mask, const reco::PFRecTrackCollection &tracks) const
 track mask set to true for rechits inside TCutG More...
 
void fillTrackMask (std::vector< bool > &mask, const reco::GsfPFRecTrackCollection &tracks) const
 
std::string getGenParticleName (int partId, std::string &latexStringName) const
 get name of genParticle More...
 
bool highPtJet (double ptMin) const
 returns true if there is at least one jet with pT>pTmin More...
 
bool highPtPFCandidate (double ptMin, reco::PFCandidate::ParticleType type=reco::PFCandidate::X) const
 returns true if there is a PFCandidate of a given type over a given pT More...
 
void initializeEventInformation ()
 
bool isHadronicTau () const
 study the sim event to check if the tau decay is hadronic More...
 
void mcTruthMatching (std::ostream &out, const reco::PFCandidateCollection &candidates, std::vector< std::list< simMatch > > &candSimMatchTrack, std::vector< std::list< simMatch > > &candSimMatchEcal) const
 
void particleFlow ()
 performs particle flow More...
 
void pfCandCompare (int)
 compare particle flow More...
 
 PFRootEventManager ()
 default constructor More...
 
 PFRootEventManager (const char *file)
 
void PreprocessRecHits (reco::PFRecHitCollection &rechits, bool findNeighbours)
 preprocess a rechit vector from a given rechit branch More...
 
void PreprocessRecTracks (reco::PFRecTrackCollection &rectracks)
 preprocess a rectrack vector from a given rectrack branch More...
 
void PreprocessRecTracks (reco::GsfPFRecTrackCollection &rectracks)
 
void print (std::ostream &out=std::cout, int maxNLines=-1) const
 print information More...
 
void printCluster (const reco::PFCluster &cluster, std::ostream &out=std::cout) const
 
void printClusters (const reco::PFClusterCollection &clusters, std::ostream &out=std::cout) const
 print clusters More...
 
void printGenParticles (std::ostream &out=std::cout, int maxNLines=-1) const
 print the HepMC truth More...
 
void printMCCalib (std::ofstream &out) const
 print calibration information More...
 
void printRecHit (const reco::PFRecHit &rh, unsigned index, const char *seed=" ", std::ostream &out=std::cout) const
 
void printRecHits (const reco::PFRecHitCollection &rechits, const PFClusterAlgo &clusterAlgo, std::ostream &out=std::cout) const
 print rechits More...
 
virtual bool processEvent (int run, int lumi, int event)
 process one event (pass the CMS event number) More...
 
void readCMSSWJets ()
 
bool readFromSimulation (int entry)
 read data from simulation tree More...
 
void readOptions (const char *file, bool refresh=true, bool reconnect=false)
 
void reconstructCaloJets ()
 reconstruct calo jets More...
 
void reconstructFWLiteJets (const reco::CandidatePtrVector &Candidates, std::vector< ProtoJet > &output)
 used by the reconstruct*Jets functions More...
 
void reconstructGenJets ()
 reconstruct gen jets More...
 
void reconstructPFJets ()
 reconstruct pf jets More...
 
void reset ()
 reset before next event More...
 
void setRecHitNeigbours (reco::PFRecHit &rh, const std::map< unsigned, unsigned > &detId2index)
 
edm::InputTag stringToTag (const std::vector< std::string > &tagname)
 returns an InputTag from a vector of strings More...
 
double tauBenchmark (const reco::PFCandidateCollection &candidates)
 COLIN need to get rid of this mess. More...
 
bool trackInsideGCut (const reco::PFTrack &track) const
 is PFTrack inside cut G ? yes if at least one trajectory point is inside. More...
 
TTree * tree ()
 get tree More...
 
virtual ~PFRootEventManager ()
 destructor More...
 

Public Attributes

int mode_
 
NeutralEventneutralEvent_
 
TTree * outTreeMy_
 
TauEventtauEvent_
 
- Public Attributes inherited from PFRootEventManager
std::ofstream * calibFile_
 
boost::shared_ptr
< PFEnergyCalibration
calibration_
 
std::vector< ProtoJetcaloJets_
 calo Jets More...
 
std::vector< reco::CaloJetcaloJetsCMSSW_
 
edm::Handle< std::vector
< reco::CaloJet > > 
caloJetsHandle_
 CMSSW calo Jets. More...
 
edm::InputTag caloJetsTag_
 
reco::CaloMETCollection caloMets_
 Calo MET. More...
 
reco::CaloMETCollection caloMetsCMSSW_
 
edm::Handle
< reco::CaloMETCollection
caloMetsHandle_
 CMSSW Calo MET. More...
 
edm::InputTag caloMetsTag_
 
CaloTowerCollection caloTowers_
 
edm::Handle< CaloTowerCollectioncaloTowersHandle_
 input collection of calotowers More...
 
reco::CandidatePtrVector caloTowersPtrs_
 
edm::InputTag caloTowersTag_
 
PFClusterAlgo clusterAlgoECAL_
 
PFClusterAlgo clusterAlgoHCAL_
 clustering algorithm for HCAL More...
 
PFClusterAlgo clusterAlgoHFEM_
 clustering algorithm for HF, electro-magnetic layer More...
 
PFClusterAlgo clusterAlgoHFHAD_
 clustering algorithm for HF, hadronic layer More...
 
PFClusterAlgo clusterAlgoPS_
 clustering algorithm for PS More...
 
boost::shared_ptr
< pftools::PFClusterCalibration
clusterCalibration_
 
std::auto_ptr
< reco::PFClusterCollection
clustersECAL_
 
edm::Handle
< reco::PFClusterCollection
clustersECALHandle_
 clusters ECAL More...
 
edm::InputTag clustersECALTag_
 
std::auto_ptr
< reco::PFClusterCollection
clustersHCAL_
 
edm::Handle
< reco::PFClusterCollection
clustersHCALHandle_
 clusters HCAL More...
 
edm::InputTag clustersHCALTag_
 
std::auto_ptr
< reco::PFClusterCollection
clustersHFEM_
 
edm::Handle
< reco::PFClusterCollection
clustersHFEMHandle_
 clusters HCAL More...
 
edm::InputTag clustersHFEMTag_
 
std::auto_ptr
< reco::PFClusterCollection
clustersHFHAD_
 
edm::Handle
< reco::PFClusterCollection
clustersHFHADHandle_
 clusters HCAL More...
 
edm::InputTag clustersHFHADTag_
 
std::auto_ptr
< reco::PFClusterCollection
clustersPS_
 
edm::Handle
< reco::PFClusterCollection
clustersPSHandle_
 clusters PS More...
 
edm::InputTag clustersPSTag_
 
reco::GsfPFRecTrackCollection convBremGsfrecTracks_
 
edm::Handle
< reco::GsfPFRecTrackCollection
convBremGsfrecTracksHandle_
 reconstructed secondary GSF tracks More...
 
edm::InputTag convBremGsfrecTracksTag_
 
reco::PFConversionCollection conversion_
 
edm::Handle
< reco::PFConversionCollection
conversionHandle_
 conversions More...
 
edm::InputTag conversionTag_
 
std::vector< reco::CaloJetcorrcaloJetsCMSSW_
 
edm::Handle< std::vector
< reco::CaloJet > > 
corrcaloJetsHandle_
 CMSSW corrected calo Jets. More...
 
edm::InputTag corrcaloJetsTag_
 
bool debug_
 debug printouts for this PFRootEventManager on/off More...
 
double DeltaMETcut
 
double DeltaPhicut
 
reco::PFRecTrackCollection displacedRecTracks_
 
edm::Handle
< reco::PFRecTrackCollection
displacedRecTracksHandle_
 
edm::InputTag displacedRecTracksTag_
 
bool doClustering_
 
bool doCompare_
 comparison with pf CMSSW More...
 
bool doJets_
 jets on/off More...
 
bool doMet_
 MET on/off. More...
 
bool doParticleFlow_
 particle flow on/off More...
 
bool doPFCandidateBenchmark_
 
bool doPFJetBenchmark_
 PFJet benchmark on/off. More...
 
bool doPFMETBenchmark_
 PFMET benchmark on/off. More...
 
bool doTauBenchmark_
 tau benchmark on/off More...
 
fwlite::ChainEventev_
 NEW: input event. More...
 
edm::EventAuxiliaryeventAuxiliary_
 event auxiliary information More...
 
TBranch * eventAuxiliaryBranch_
 
bool fastsim_
 Fastsim or fullsim. More...
 
TFile * file_
 input file More...
 
bool filterHadronicTaus_
 
unsigned filterNParticles_
 
std::vector< int > filterTaus_
 
bool findRecHitNeighbours_
 find rechit neighbours ? More...
 
reco::GenJetCollection genJets_
 gen Jets More...
 
reco::GenJetCollection genJetsCMSSW_
 
edm::Handle
< reco::GenJetCollection
genJetsHandle_
 CMSSW gen Jets. More...
 
edm::InputTag genJetsTag_
 
reco::GenParticleCollection genParticlesCMSSW_
 
reco::GenParticleRefVector genParticlesforJets_
 
edm::Handle
< reco::GenParticleRefVector
genParticlesforJetsHandle_
 input collection of gen particles More...
 
reco::CandidatePtrVector genParticlesforJetsPtrs_
 
edm::InputTag genParticlesforJetsTag_
 
edm::Handle
< reco::GenParticleCollection
genParticlesforMETHandle_
 CMSSW GenParticles. More...
 
edm::InputTag genParticlesforMETTag_
 
reco::GsfPFRecTrackCollection gsfrecTracks_
 
edm::Handle
< reco::GsfPFRecTrackCollection
gsfrecTracksHandle_
 reconstructed GSF tracks More...
 
edm::InputTag gsfrecTracksTag_
 
TH1F * h_deltaETvisible_MCEHT_
 output histo dET ( EHT - MC) More...
 
TH1F * h_deltaETvisible_MCPF_
 output histo dET ( PF - MC) More...
 
int iEvent_
 current event More...
 
std::vector< std::string > inFileNames_
 input file names More...
 
bool JECinCaloMet_
 propagate the Jet Energy Corrections to the caloMET on/off More...
 
PFJetAlgorithm jetAlgo_
 
int jetAlgoType_
 jet algo type More...
 
FWLiteJetProducer jetMaker_
 wrapper to official jet algorithms More...
 
bool jetsDebug_
 debug printouts for jet algo on/off More...
 
RunsMap mapEventToEntry_
 
edm::HepMCProduct MCTruth_
 
edm::Handle< edm::HepMCProductMCTruthHandle_
 MC truth. More...
 
edm::InputTag MCTruthTag_
 
double MET1cut
 PFMET Benchmark. More...
 
std::auto_ptr< METManagermetManager_
 
reco::MuonCollection muons_
 
edm::Handle< reco::MuonCollectionmuonsHandle_
 muons More...
 
edm::InputTag muonsTag_
 
IOoptions_
 options file parser More...
 
EventColinoutEvent_
 
TFile * outFile_
 output file More...
 
std::string outFileName_
 output filename More...
 
TTree * outTree_
 output tree More...
 
PFAlgo pfAlgo_
 particle flow algorithm More...
 
PFBlockAlgo pfBlockAlgo_
 algorithm for building the particle flow blocks More...
 
std::auto_ptr
< reco::PFBlockCollection
pfBlocks_
 reconstructed pfblocks More...
 
reco::PFCandidateCollection pfCandCMSSW_
 
edm::Handle
< reco::PFCandidateCollection
pfCandidateHandle_
 CMSSW PF candidates. More...
 
PFCandidateManager pfCandidateManager_
 
std::auto_ptr
< reco::PFCandidateCollection
pfCandidates_
 reconstructed pfCandidates More...
 
reco::CandidatePtrVector pfCandidatesPtrs_
 
edm::InputTag pfCandidateTag_
 
PFJetBenchmark PFJetBenchmark_
 PFJet Benchmark. More...
 
reco::PFJetCollection pfJets_
 PF Jets. More...
 
reco::PFJetCollection pfJetsCMSSW_
 
edm::Handle
< reco::PFJetCollection
pfJetsHandle_
 CMSSW PF Jets. More...
 
edm::InputTag pfJetsTag_
 
reco::PFMETCollection pfMets_
 PF MET. More...
 
reco::PFMETCollection pfMetsCMSSW_
 
edm::Handle
< reco::PFMETCollection
pfMetsHandle_
 CMSSW PF MET. More...
 
edm::InputTag pfMetsTag_
 
reco::PFDisplacedTrackerVertexCollection pfNuclearTrackerVertex_
 
edm::Handle
< reco::PFDisplacedTrackerVertexCollection
pfNuclearTrackerVertexHandle_
 PFDisplacedVertex. More...
 
edm::InputTag pfNuclearTrackerVertexTag_
 
reco::VertexCollection primaryVertices_
 
edm::Handle
< reco::VertexCollection
primaryVerticesHandle_
 reconstructed primary vertices More...
 
edm::InputTag primaryVerticesTag_
 
bool printClusters_
 print clusters yes/no More...
 
double printClustersEMin_
 
bool printGenParticles_
 print MC truth yes/no More...
 
double printGenParticlesPtMin_
 
bool printMCTruthMatching_
 
bool printPFBlocks_
 print PFBlocks yes/no More...
 
bool printPFCandidates_
 print PFCandidates yes/no More...
 
double printPFCandidatesPtMin_
 
bool printPFJets_
 print PFJets yes/no More...
 
double printPFJetsPtMin_
 
bool printRecHits_
 print rechits yes/no More...
 
double printRecHitsEMin_
 
bool printSimParticles_
 print true particles yes/no More...
 
double printSimParticlesPtMin_
 
reco::PFRecHitCollection rechitsCLEANED_
 
std::vector< edm::Handle
< reco::PFRecHitCollection > > 
rechitsCLEANEDHandles_
 
std::vector< edm::InputTagrechitsCLEANEDTags_
 
std::vector
< reco::PFRecHitCollection
rechitsCLEANEDV_
 rechits HF CLEANED More...
 
reco::PFRecHitCollection rechitsECAL_
 
edm::Handle
< reco::PFRecHitCollection
rechitsECALHandle_
 rechits ECAL More...
 
edm::InputTag rechitsECALTag_
 
reco::PFRecHitCollection rechitsHCAL_
 
edm::Handle
< reco::PFRecHitCollection
rechitsHCALHandle_
 rechits HCAL More...
 
edm::InputTag rechitsHCALTag_
 
reco::PFRecHitCollection rechitsHFEM_
 
edm::Handle
< reco::PFRecHitCollection
rechitsHFEMHandle_
 rechits HF EM More...
 
edm::InputTag rechitsHFEMTag_
 
reco::PFRecHitCollection rechitsHFHAD_
 
edm::Handle
< reco::PFRecHitCollection
rechitsHFHADHandle_
 rechits HF HAD More...
 
edm::InputTag rechitsHFHADTag_
 
reco::PFRecHitCollection rechitsPS_
 
edm::Handle
< reco::PFRecHitCollection
rechitsPSHandle_
 rechits PS More...
 
edm::InputTag rechitsPSTag_
 
reco::PFRecTrackCollection recTracks_
 
edm::Handle
< reco::PFRecTrackCollection
recTracksHandle_
 reconstructed tracks More...
 
edm::InputTag recTracksTag_
 
reco::TrackCollection stdTracks_
 
edm::Handle
< reco::TrackCollection
stdTracksHandle_
 standard reconstructed tracks More...
 
edm::InputTag stdTracksTag_
 
bool tauBenchmarkDebug_
 tau benchmark debug More...
 
reco::METCollection tcMets_
 TCMET. More...
 
reco::METCollection tcMetsCMSSW_
 
edm::Handle< reco::METCollectiontcMetsHandle_
 CMSSW TCMET. More...
 
edm::InputTag tcMetsTag_
 
boost::shared_ptr
< PFEnergyCalibrationHF
thepfEnergyCalibrationHF_
 
TTree * tree_
 input tree More...
 
reco::PFSimParticleCollection trueParticles_
 
edm::Handle
< reco::PFSimParticleCollection
trueParticlesHandle_
 true particles More...
 
edm::InputTag trueParticlesTag_
 
bool useAtHLT
 Use HLT tracking. More...
 
bool useConvBremGsfTracks_
 Use Secondary Gsf Tracks. More...
 
bool useConvBremPFRecTracks_
 Use Conv Brem KF Tracks. More...
 
bool usePFConversions_
 Use of conversions in PFAlgo. More...
 
bool usePFNuclearInteractions_
 Use of PFDisplacedVertex in PFAlgo. More...
 
bool usePFV0s_
 Use of V0 in PFAlgo. More...
 
reco::PFV0Collection v0_
 
edm::Handle< reco::PFV0Collectionv0Handle_
 V0. More...
 
edm::InputTag v0Tag_
 
int verbosity_
 verbosity More...
 

Detailed Description

Definition at line 63 of file PFRootEventManagerColin.h.

Member Enumeration Documentation

Enumerator
Neutral 
HIGH_E_TAUS 

Definition at line 80 of file PFRootEventManagerColin.h.

Constructor & Destructor Documentation

PFRootEventManagerColin::PFRootEventManagerColin ( const char *  file)

Definition at line 11 of file PFRootEventManagerColin.cc.

References neutralEvent_, outTreeMy_, readSpecificOptions(), and tauEvent_.

13 
14  tauEvent_ = 0;
15  neutralEvent_ = 0;
16  outTreeMy_ = 0;
17 
18  // readOptions(file, false, false);
19 
20  // book histos here
21  // neutralEvent_ = new NeutralEvent();
22 
23 
24  // tauEvent_ = new TauEvent();
25  // outTree_ = new TTree("Tau","");
26  // outTree_->Branch("event","TauEvent", &tauEvent_,32000,2);
27 
29 
30 }
void readSpecificOptions(const char *file)
list file
Definition: dbtoweb.py:253
PFRootEventManager()
default constructor
PFRootEventManagerColin::~PFRootEventManagerColin ( )

Definition at line 32 of file PFRootEventManagerColin.cc.

32  {
33 
34  // delete event_;
35  // delete outTree_;
36 }

Member Function Documentation

bool PFRootEventManagerColin::processEntry ( int  entry)
virtual

process one entry (pass the TTree entry)

Reimplemented from PFRootEventManager.

Definition at line 77 of file PFRootEventManagerColin.cc.

References ExpressReco_HICollisions_FallBack::cerr, HIGH_E_TAUS, mode_, Neutral, outTreeMy_, PFRootEventManager::processEntry(), processHIGH_E_TAUS(), processNeutral(), NeutralEvent::rCode, TauEvent::reset(), and tauEvent_.

77  {
78 
79  tauEvent_->reset();
80 
82  // cerr<<"event was not accepted"<<endl;
83  // print();
84  tauEvent_->rCode = 10;
85  return false; // event not accepted
86  }
87 
88  bool rvalue = false;
89  switch(mode_) {
90  case Neutral:
91  // cout<<"colin: process Neutral"<<endl;
92  rvalue = processNeutral();
93  break;
94  case HIGH_E_TAUS:
95  // cout<<"colin: process highETaus"<<endl;
96  rvalue = processHIGH_E_TAUS();
97  break;
98  default:
99  cerr<<"colin: undefined mode"<<endl;
100  assert(0);
101  }
102  outTreeMy_->Fill();
103 
104 
105  outTreeMy_->Fill();
106 
107 
108  outTreeMy_->Fill();
109 
110 
111  return rvalue;
112 }
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
virtual bool processEntry(int entry)
process one entry (pass the TTree entry)
bool PFRootEventManagerColin::processHIGH_E_TAUS ( )

Definition at line 192 of file PFRootEventManagerColin.cc.

References abs, reco::PFBlock::associatedElements(), Association::block, DeDxDiscriminatorTools::charge(), reco::PFTrack::charge(), ExpressReco_HICollisions_FallBack::chi2, TauEvent::chi2ECAL, reco::PFTrajectoryPoint::ClosestApproach, PFRootEventManager::clustersECAL_, PFRootEventManager::clustersHCAL_, reco::PFSimParticle::daughterIds(), reco::PFBlockElement::ECAL, NeutralEvent::eECAL, NeutralEvent::eHCAL, reco::PFBlock::elements(), asciidump::elements, NeutralEvent::eNeutral, NeutralEvent::etaECAL, NeutralEvent::etaHCAL, NeutralEvent::etaNeutral, TauEvent::etaTrack, reco::PFBlockElement::HCAL, i, getHLTprescales::index, edm::Ref< C, T, F >::isNull(), reco::PFBlock::linkData(), NeutralEvent::nECAL, NeutralEvent::nHCAL, reco::PFSimParticle::pdgCode(), PFRootEventManager::pfBlocks_, TauEvent::pHadron, TauEvent::pTrack, TauEvent::ptTrack, NeutralEvent::rCode, PFRootEventManager::recTracks_, edm::OwnVector< T, P >::size(), tauEvent_, reco::PFBlockElement::TRACK, and PFRootEventManager::trueParticles_.

Referenced by processEntry().

192  {
193 
194 
195  // true info
196  // 1 charged hadron, 2 photons
197  // save charged part mom, save sum E photons
198 
199 
200  int iHadron = -1;
201  int iPi0 = -1;
202  unsigned nStableChargedHadrons=0;
203  unsigned nPi0=0;
204  for(unsigned i=0; i<trueParticles_.size(); i++) {
205 
207 
208  int pdgCode = part.pdgCode();
209  double charge = part.charge();
210 
211  if( std::abs(pdgCode) > 100 &&
212  charge !=0 &&
213  part.daughterIds().empty() ) {
214  nStableChargedHadrons++;
215  iHadron = i;
216  }
217  else if( std::abs(pdgCode)==111) {
218  nPi0++;
219  iPi0 = i;
220  }
221 
222  // cout<<i<<" "<<part<<endl;
223  }
224 
225 
226  // one has to select 1 charged and 2 photons
227  // to use this function.
228 
229  // even after filtering events with one stable charged particle,
230  // this particle can be a lepton (eg leptonic pion decay)
231  if( nStableChargedHadrons==0 ) {
232  tauEvent_->rCode = 4;
233  return false;
234  }
235  assert( nStableChargedHadrons==1 );
236 
237 
238 
239  double pHadron = trueParticles_[iHadron].extrapolatedPoint(reco::PFTrajectoryPoint::ClosestApproach ).momentum().P();
240  tauEvent_->pHadron = pHadron;
241 
242  // tauEvent_->eEcalHadron = trueParticles_[iHadron].ecalEnergy();
243 
244  if(nPi0 == 1) {
245  math::XYZTLorentzVector pi0mom = trueParticles_[iPi0].extrapolatedPoint(reco::PFTrajectoryPoint::ClosestApproach ).momentum();
246  tauEvent_->eNeutral = pi0mom.E();
247  tauEvent_->etaNeutral = pi0mom.Eta();
248  }
249  else {
250  tauEvent_->eNeutral = 0;
251  }
252 
253  // if( tauEvent_->eNeutral > 0.1* tauEvent_->pHadron ) {
254  // print();
255  // }
256 
257 
258  // check that there is
259  // only one track
260  // 0 or 1 ecal cluster
261  // 0 or 1 hcal cluster
262 
263  if( recTracks_.size() != 1 ) {
264  // cout<<"more than 1 track"<<endl;
265  tauEvent_->rCode = 1;
266  return false;
267  }
268  if( clustersECAL_->size() > 1 ) {
269  // cout<<"more than 1 ecal cluster"<<endl;
270  tauEvent_->rCode = 2;
271  // return false;
272  }
273  if( clustersHCAL_->size() > 1 ) {
274  // cout<<"more than 1 hcal cluster"<<endl;
275  tauEvent_->rCode = 3;
276  return false;
277  }
278  // save track mom + neutral info.
279 
280  tauEvent_->pTrack = recTracks_[0].extrapolatedPoint(reco::PFTrajectoryPoint::ClosestApproach ).momentum().P();
281  tauEvent_->ptTrack = recTracks_[0].extrapolatedPoint(reco::PFTrajectoryPoint::ClosestApproach ).momentum().Pt();
282  tauEvent_->etaTrack = recTracks_[0].extrapolatedPoint(reco::PFTrajectoryPoint::ClosestApproach ).momentum().Eta();
283 
284  // access blocks
285 
286  // take the track block
287 
288  // look for the closest associated ecal and hcal clusters
289 
290  // fill the tree
291 
292 
293 
294 
295  for(unsigned i=0; i<pfBlocks_->size(); i++) {
296  const reco::PFBlock& block = (*pfBlocks_)[i];
297 
299  elements = block.elements();
300 
301  // look for the track
302  int iTrack = -1;
303  unsigned nTracks = 0;
304  for(unsigned ie=0; ie<elements.size(); ie++) {
305  if(elements[ie].type() == reco::PFBlockElement::TRACK ) {
306  iTrack = ie;
307  nTracks++;
308  }
309  }
310 
311  if(nTracks!=1) continue; // no track, or too many tracks in the block
312 
313  std::multimap<double, unsigned> sortedElems;
314  block.associatedElements( iTrack,
315  block.linkData(),
316  sortedElems );
317 
318  tauEvent_->nECAL=0;
319  tauEvent_->nHCAL=0;
320 
321  typedef std::multimap<double, unsigned>::iterator IE;
322  for(IE ie = sortedElems.begin(); ie != sortedElems.end(); ++ie ) {
323 
324 
325  double chi2 = ie->first;
326  unsigned index = ie->second;
327 
328  reco::PFBlockElement::Type type = elements[index].type();
329 
330  reco::PFClusterRef clusterRef = elements[index].clusterRef();
331 
332 
333 
334 
335  if( type == reco::PFBlockElement::ECAL ) {
336  if(!tauEvent_->nECAL ) { // closest ecal
337  assert( !clusterRef.isNull() );
338  tauEvent_->eECAL = clusterRef->energy();
339  tauEvent_->etaECAL = clusterRef->position().Eta();
341  tauEvent_->nECAL++;
342  }
343  }
344 
345 
346  else if( type == reco::PFBlockElement::HCAL ) {
347  if(!tauEvent_->nHCAL ) { // closest hcal
348  assert( !clusterRef.isNull() );
349  tauEvent_->eHCAL = clusterRef->energy();
350  tauEvent_->etaHCAL = clusterRef->position().Eta();
351  tauEvent_->nHCAL++;
352  }
353  }
354  } // eles associated to the track
355  } // blocks
356 
357 
358 
359 
360  return false;
361 }
std::auto_ptr< reco::PFBlockCollection > pfBlocks_
reconstructed pfblocks
const std::vector< int > & daughterIds() const
Definition: PFSimParticle.h:44
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
std::auto_ptr< reco::PFClusterCollection > clustersECAL_
size_type size() const
Definition: OwnVector.h:260
#define abs(x)
Definition: mlp_lapack.h:159
list elements
Definition: asciidump.py:414
const edm::OwnVector< reco::PFBlockElement > & elements() const
Definition: PFBlock.h:107
int pdgCode() const
Definition: PFSimParticle.h:35
const LinkData & linkData() const
Definition: PFBlock.h:112
std::auto_ptr< reco::PFClusterCollection > clustersHCAL_
reco::PFRecTrackCollection recTracks_
double charge(const std::vector< uint8_t > &Ampls)
reco::PFSimParticleCollection trueParticles_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
bool isNull() const
Checks for null.
Definition: Ref.h:244
Point of closest approach from beam axis (initial point in the case of PFSimParticle) ...
block
Formating index page&#39;s pieces.
Definition: Association.py:187
true particle for particle flow
Definition: PFSimParticle.h:19
void associatedElements(unsigned i, const LinkData &linkData, std::multimap< double, unsigned > &sortedAssociates, reco::PFBlockElement::Type type=PFBlockElement::NONE, LinkTest test=LINKTEST_RECHIT) const
Definition: PFBlock.cc:75
part
Definition: HCALResponse.h:21
double charge() const
Definition: PFTrack.h:87
Block of elements.
Definition: PFBlock.h:30
bool PFRootEventManagerColin::processNeutral ( )

Definition at line 117 of file PFRootEventManagerColin.cc.

References ExpressReco_HICollisions_FallBack::cerr, NeutralEvent::eECAL, NeutralEvent::eHCAL, NeutralEvent::eNeutral, eta(), NeutralEvent::etaNeutral, configurableAnalysis::GenParticle, edm::HepMCProduct::GetEvent(), i, PFRootEventManager::MCTruth_, NeutralEvent::nECAL, neutralEvent_, NeutralEvent::nHCAL, outTreeMy_, phi, and NeutralEvent::reset().

Referenced by processEntry().

117  {
118  // else {
119  // cerr<<"event accepted"<<endl;
120  // }
121 
122  // if( ! ( (*clustersECAL_).size() <= 1 &&
123  // (*clustersHCAL_).size() <= 1 ) ) {
124  // cerr<<"wrong number of ECAL or HCAL clusters :"
125  // <<(*clustersECAL_).size()<<","<<(*clustersHCAL_).size()<<endl;
126  // return false;
127  // }
128  // 1 HCAL cluster
129 
130  neutralEvent_->reset();
131 
132  // particle
133 
134  const HepMC::GenEvent* myGenEvent = MCTruth_.GetEvent();
135  if(!myGenEvent) {
136  assert(0);
137  }
138 
139  if( myGenEvent->particles_size() != 1 ) {
140  cerr<<"wrong number of particles:"
141  <<myGenEvent->particles_size()<<endl;
142  return 0;
143  }
144 
145  // take first particle
146  const HepMC::GenParticle* particle = *(myGenEvent->particles_begin() );
147 
148  // and check that it's a K0L
149  if( particle->pdg_id() != 130 ) {
150  cerr<<"not a K0L : "<<particle->pdg_id()<<endl;
151  return false;
152  }
153 
154  neutralEvent_->eNeutral = particle->momentum().e();
155 
156  double eta = particle->momentum().eta();
157  double phi = particle->momentum().phi();
159 
160 
161  neutralEvent_->nECAL = (*clustersECAL_).size();
162 
163  // look for the closest ECAL cluster from the particle.
164 
165  double minDist2 = 9999999;
166  // int iClosest = -1;
167  for( unsigned i=0; i<(*clustersECAL_).size(); ++i) {
168  double deta = (*clustersECAL_)[i].position().Eta() - eta;
169  double dphi = (*clustersECAL_)[i].position().Phi() - phi;
170  double dist2 = deta*deta + dphi*dphi;
171  if(dist2 < minDist2) {
172  minDist2 = dist2;
173  neutralEvent_->eECAL = (*clustersECAL_)[i].energy();
174  }
175  }
176 
177 
178  neutralEvent_->nHCAL = (*clustersHCAL_).size();
179  if( (*clustersHCAL_).size() == 1 ) {
180  neutralEvent_->eHCAL = (*clustersHCAL_)[0].energy();
181  }
182 
183 
184  outTreeMy_->Fill();
185 
187  return true;
188  else return false;
189 }
virtual void reset()
int i
Definition: DBlmapReader.cc:9
T eta() const
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:36
edm::HepMCProduct MCTruth_
Definition: DDAxes.h:10
void PFRootEventManagerColin::readSpecificOptions ( const char *  file)
virtual

Reimplemented from PFRootEventManager.

Definition at line 39 of file PFRootEventManagerColin.cc.

References ExpressReco_HICollisions_FallBack::cerr, gather_cfg::cout, cmsRelvalreport::exit, IO::GetOpt(), HIGH_E_TAUS, mode_, Neutral, neutralEvent_, PFRootEventManager::options_, PFRootEventManager::outFile_, outTreeMy_, and tauEvent_.

Referenced by PFRootEventManagerColin().

39  {
40 
41 
42 
43  cout<<"calling PFRootEventManagerColin::readSpecificOptions"<<endl;
44  // PFRootEventManager::readOptions(file, refresh, reconnect);
45 
46 
47  options_->GetOpt("colin", "mode", mode_);
48 
49  if(outTreeMy_) delete outTreeMy_;
50 
51  outFile_->cd();
52  switch(mode_) {
53  case Neutral:
54  cout<<"colin: Neutral mode"<<endl;
55  neutralEvent_ = new NeutralEvent();
56  outTreeMy_ = new TTree("Neutral","");
57  outTreeMy_->Branch("event","NeutralEvent", &neutralEvent_,32000,2);
58  gDirectory->ls();
59  break;
60  case HIGH_E_TAUS:
61  cout<<"colin: highETaus mode"<<endl;
62  tauEvent_ = new TauEvent();
63  outTreeMy_ = new TTree("Tau","");
64  outTreeMy_->Branch("event","TauEvent", &tauEvent_,32000,2);
65  gDirectory->ls();
66  break;
67  default:
68  cerr<<"colin: undefined mode"<<endl;
69  exit(1);
70  }
71 }
IO * options_
options file parser
bool GetOpt(const char *tag, const char *key, std::vector< T > &values) const
reads a vector of T
Definition: IO.h:106
TFile * outFile_
output file
tuple cout
Definition: gather_cfg.py:41
void PFRootEventManagerColin::write ( void  )
virtual

Reimplemented from PFRootEventManager.

Definition at line 366 of file PFRootEventManagerColin.cc.

References PFRootEventManager::outFile_, outTreeMy_, and PFRootEventManager::write().

366  {
367  // write histos here
368  outFile_->cd();
369  outTreeMy_->Write();
370 
372 }
TFile * outFile_
output file

Member Data Documentation

int PFRootEventManagerColin::mode_

Definition at line 88 of file PFRootEventManagerColin.h.

Referenced by processEntry(), and readSpecificOptions().

NeutralEvent* PFRootEventManagerColin::neutralEvent_
TTree* PFRootEventManagerColin::outTreeMy_
TauEvent* PFRootEventManagerColin::tauEvent_