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
PFRootEventManager Class Reference

ROOT interface to particle flow package. More...

#include <PFRootEventManager.h>

Inheritance diagram for PFRootEventManager:
MyPFRootEventManager PFRootEventManagerColin

Public Types

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

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 fillPhotonMask (std::vector< bool > &mask, const reco::PhotonCollection &photons) const
 photon mask set to true for photons inside TCutG 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 processEntry (int entry)
 process one entry (pass the TTree entry) 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)
 
virtual void readSpecificOptions (const char *file)
 
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 void write ()
 
virtual ~PFRootEventManager ()
 destructor More...
 

Public Attributes

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 clusterAlgoHO_
 clustering algorithm for HO 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
clustersHO_
 
edm::Handle
< reco::PFClusterCollection
clustersHOHandle_
 clusters HO More...
 
edm::InputTag clustersHOTag_
 
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 doPFDQM_
 
bool doPFJetBenchmark_
 PFJet benchmark on/off. More...
 
bool doPFMETBenchmark_
 PFMET benchmark on/off. More...
 
bool doTauBenchmark_
 tau benchmark on/off More...
 
TFile * dqmFile_
 
reco::SuperClusterCollection ebsc_
 superclusters More...
 
reco::SuperClusterCollection eesc_
 
edm::Handle
< reco::GsfElectronCollection
egammaElectronHandle_
 
reco::GsfElectronCollection egammaElectrons_
 
edm::InputTag egammaElectronsTag_
 
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_
 
std::auto_ptr
< reco::PFCandidateElectronExtraCollection
pfCandidateElectronExtras_
 PFCandidateElectronExtra. More...
 
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...
 
PFJetMonitor pfJetMonitor_
 
reco::PFJetCollection pfJets_
 PF Jets. More...
 
reco::PFJetCollection pfJetsCMSSW_
 
edm::Handle
< reco::PFJetCollection
pfJetsHandle_
 CMSSW PF Jets. More...
 
edm::InputTag pfJetsTag_
 
PFMETMonitor pfMETMonitor_
 
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_
 
edm::Handle
< reco::PhotonCollection
photonHandle_
 photons More...
 
reco::PhotonCollection photons_
 
edm::InputTag photonTag_
 
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 rechitsHO_
 
edm::Handle
< reco::PFRecHitCollection
rechitsHOHandle_
 rechits HO More...
 
edm::InputTag rechitsHOTag_
 
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 useEGElectrons_
 Use EGElectrons. More...
 
bool useEGPhotons_
 Use EGPhotons. More...
 
bool useHO_
 Use of HO in links with tracks/HCAL and in particle flow reconstruction. More...
 
bool useKDTreeTrackEcalLinker_
 ECAL-track link optimization. More...
 
bool usePFConversions_
 Use of conversions in PFAlgo. More...
 
bool usePFElectrons_
 Use PFElectrons. 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

ROOT interface to particle flow package.

This base class allows to perform clustering and particle flow from ROOT CINT (or any program). It is designed to support analysis and developpement. Users should feel free to create their own PFRootEventManager, inheriting from this base class. Just reimplement the ProcessEntry function

An example:

gSystem->Load("libFWCoreFWLite.so");
gSystem->Load("libRecoParticleFlowPFRootEvent.so");
gSystem->Load("libCintex.so");
ROOT::Cintex::Cintex::Enable();
PFRootEventManager em("pfRootEvent.opt");
int i=0;
em.processEntry( i++ )

pfRootEvent.opt is an option file (see IO class):

root file test.root

root hits_branch  recoPFRecHits_pfcluster__Demo.obj
root recTracks_branch  recoPFRecTracks_pf_PFRecTrackCollection_Demo.obj

display algos 1 

display  viewsize_etaphi 600 400
display  viewsize_xy     400 400

display  color_clusters               1

clustering thresh_Ecal_Barrel           0.2
clustering thresh_Seed_Ecal_Barrel      0.3
clustering thresh_Ecal_Endcap           0.2
clustering thresh_Seed_Ecal_Endcap      0.9
clustering neighbours_Ecal            4

clustering depthCor_Mode          1
clustering depthCor_A                   0.89
clustering depthCor_B                   7.3
clustering depthCor_A_preshower   0.89
clustering depthCor_B_preshower   4.0

clustering thresh_Hcal_Barrel           1.0
clustering thresh_Seed_Hcal_Barrel      1.4
clustering thresh_Hcal_Endcap           1.0
clustering thresh_Seed_Hcal_Endcap      1.4
clustering neighbours_Hcal            4
Author
Colin Bernet, Renaud Bruneliere
Date
July 2006

Definition at line 190 of file PFRootEventManager.h.

Member Typedef Documentation

typedef std::map<int, int> PFRootEventManager::EventToEntry

Definition at line 895 of file PFRootEventManager.h.

Definition at line 896 of file PFRootEventManager.h.

typedef std::map<int, LumisMap> PFRootEventManager::RunsMap

Definition at line 897 of file PFRootEventManager.h.

Member Enumeration Documentation

Enumerator
SHUTUP 
VERBOSE 

Definition at line 196 of file PFRootEventManager.h.

viewport definition

Enumerator
XY 
RZ 
EPE 
EPH 
NViews 

Definition at line 195 of file PFRootEventManager.h.

Constructor & Destructor Documentation

PFRootEventManager::PFRootEventManager ( )

default constructor

Definition at line 58 of file PFRootEventManager.cc.

58 {}
PFRootEventManager::PFRootEventManager ( const char *  file)
Parameters
isan option file, see IO

Definition at line 62 of file PFRootEventManager.cc.

References h_deltaETvisible_MCEHT_, h_deltaETvisible_MCPF_, initializeEventInformation(), and readOptions().

63  :
64  iEvent_(0),
65  options_(0),
66  ev_(0),
67  tree_(0),
68  outTree_(0),
69  outEvent_(0),
70  // clusters_(new reco::PFClusterCollection),
81  //pfJets_(new reco::PFJetCollection),
82  outFile_(0),
83  calibFile_(0)
84 {
85 
86 
87  // iEvent_=0;
89  = new TH1F("h_deltaETvisible_MCEHT","Jet Et difference CaloTowers-MC"
90  ,1000,-50.,50.);
92  = new TH1F("h_deltaETvisible_MCPF" ,"Jet Et difference ParticleFlow-MC"
93  ,1000,-50.,50.);
94 
95  readOptions(file, true, true);
96 
98 
99  // maxERecHitEcal_ = -1;
100  // maxERecHitHcal_ = -1;
101 
102 }
std::auto_ptr< reco::PFBlockCollection > pfBlocks_
reconstructed pfblocks
edm::EventAuxiliary * eventAuxiliary_
event auxiliary information
fwlite::ChainEvent * ev_
NEW: input event.
IO * options_
options file parser
std::auto_ptr< reco::PFClusterCollection > clustersECAL_
std::auto_ptr< reco::PFClusterCollection > clustersHCAL_
int iEvent_
current event
void readOptions(const char *file, bool refresh=true, bool reconnect=false)
TTree * outTree_
output tree
std::auto_ptr< reco::PFClusterCollection > clustersPS_
TFile * outFile_
output file
std::ofstream * calibFile_
TH1F * h_deltaETvisible_MCPF_
output histo dET ( PF - MC)
TTree * tree_
input tree
std::auto_ptr< reco::PFCandidateElectronExtraCollection > pfCandidateElectronExtras_
PFCandidateElectronExtra.
std::auto_ptr< reco::PFClusterCollection > clustersHO_
std::vector< PFBlock > PFBlockCollection
collection of PFBlock objects
Definition: PFBlockFwd.h:11
TH1F * h_deltaETvisible_MCEHT_
output histo dET ( EHT - MC)
std::auto_ptr< reco::PFCandidateCollection > pfCandidates_
reconstructed pfCandidates
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
std::auto_ptr< reco::PFClusterCollection > clustersHFEM_
std::auto_ptr< reco::PFClusterCollection > clustersHFHAD_
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
std::vector< reco::PFCandidateElectronExtra > PFCandidateElectronExtraCollection
collection of PFCandidateElectronExtras
PFRootEventManager::~PFRootEventManager ( )
virtual

destructor

Definition at line 1869 of file PFRootEventManager.cc.

References options_, outEvent_, and outFile_.

1869  {
1870 
1871  if(outFile_) {
1872  outFile_->Close();
1873  }
1874 
1875  if(outEvent_) delete outEvent_;
1876 
1877  delete options_;
1878 
1879 }
IO * options_
options file parser
TFile * outFile_
output file

Member Function Documentation

const reco::PFBlockCollection& PFRootEventManager::blocks ( ) const
inline

Definition at line 391 of file PFRootEventManager.h.

References pfBlocks_.

Referenced by DisplayManager::findBlock().

391 { return *pfBlocks_; }
std::auto_ptr< reco::PFBlockCollection > pfBlocks_
reconstructed pfblocks
int PFRootEventManager::chargeValue ( const int &  pdgId) const

return the chargex3

Definition at line 2704 of file PFRootEventManager.cc.

References abs.

2704  {
2705 
2706 
2707  //...Purpose: to give three times the charge for a particle/parton.
2708 
2709  // ID = particle ID
2710  // hepchg = particle charge times 3
2711 
2712  int kqa,kq1,kq2,kq3,kqj,irt,kqx,kqn;
2713  int hepchg;
2714 
2715 
2716  int ichg[109]={-1,2,-1,2,-1,2,-1,2,0,0,-3,0,-3,0,-3,0,
2717  -3,0,0,0,0,0,0,3,0,0,0,0,0,0,3,0,3,6,0,0,3,6,0,0,-1,2,-1,2,-1,2,0,0,0,0,
2718  -3,0,-3,0,-3,0,0,0,0,0,-1,2,-1,2,-1,2,0,0,0,0,
2719  -3,0,-3,0,-3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
2720 
2721 
2722  //...Initial values. Simple case of direct readout.
2723  hepchg=0;
2724  kqa=std::abs(Id);
2725  kqn=kqa/1000000000%10;
2726  kqx=kqa/1000000%10;
2727  kq3=kqa/1000%10;
2728  kq2=kqa/100%10;
2729  kq1=kqa/10%10;
2730  kqj=kqa%10;
2731  irt=kqa%10000;
2732 
2733  //...illegal or ion
2734  //...set ion charge to zero - not enough information
2735  if(kqa==0 || kqa >= 10000000) {
2736 
2737  if(kqn==1) {hepchg=0;}
2738  }
2739  //... direct translation
2740  else if(kqa<=100) {hepchg = ichg[kqa-1];}
2741  //... deuteron or tritium
2742  else if(kqa==100 || kqa==101) {hepchg = -3;}
2743  //... alpha or He3
2744  else if(kqa==102 || kqa==104) {hepchg = -6;}
2745  //... KS and KL (and undefined)
2746  else if(kqj == 0) {hepchg = 0;}
2747  //C... direct translation
2748  else if(kqx>0 && irt<100)
2749  {
2750  hepchg = ichg[irt-1];
2751  if(kqa==1000017 || kqa==1000018) {hepchg = 0;}
2752  if(kqa==1000034 || kqa==1000052) {hepchg = 0;}
2753  if(kqa==1000053 || kqa==1000054) {hepchg = 0;}
2754  if(kqa==5100061 || kqa==5100062) {hepchg = 6;}
2755  }
2756  //...Construction from quark content for heavy meson, diquark, baryon.
2757  //...Mesons.
2758  else if(kq3==0)
2759  {
2760  hepchg = ichg[kq2-1]-ichg[kq1-1];
2761  //...Strange or beauty mesons.
2762  if((kq2==3) || (kq2==5)) {hepchg = ichg[kq1-1]-ichg[kq2-1];}
2763  }
2764  else if(kq1 == 0) {
2765  //...Diquarks.
2766  hepchg = ichg[kq3-1] + ichg[kq2-1];
2767  }
2768 
2769  else{
2770  //...Baryons
2771  hepchg = ichg[kq3-1]+ichg[kq2-1]+ichg[kq1-1];
2772  }
2773 
2774  //... fix sign of charge
2775  if(Id<0 && hepchg!=0) {hepchg = -1*hepchg;}
2776 
2777  // cout << hepchg<< endl;
2778  return hepchg;
2779 }
#define abs(x)
Definition: mlp_lapack.h:159
const reco::PFSimParticle & PFRootEventManager::closestParticle ( 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

Definition at line 4542 of file PFRootEventManager.cc.

References eta(), reco::PFTrack::extrapolatedPoint(), i, reco::PFTrajectoryPoint::momentum(), reco::PFTrajectoryPoint::NLayers, reco::PFTrack::nTrajectoryMeasurements(), reco::PFTrack::nTrajectoryPoints(), phi, reco::PFTrajectoryPoint::position(), and trueParticles_.

Referenced by fillOutEventWithClusters().

4545  {
4546 
4547 
4548  if( trueParticles_.empty() ) {
4549  string err = "PFRootEventManager::closestParticle : ";
4550  err += "vector of PFSimParticles is empty";
4551  throw std::length_error( err.c_str() );
4552  }
4553 
4554  double mindist2 = 99999999;
4555  unsigned iClosest=0;
4556  for(unsigned i=0; i<trueParticles_.size(); i++) {
4557 
4558  const reco::PFSimParticle& ptc = trueParticles_[i];
4559 
4560  // protection for old version of the PFSimParticle
4561  // dataformats.
4562  if( layer >= reco::PFTrajectoryPoint::NLayers ||
4563  ptc.nTrajectoryMeasurements() + layer >=
4564  ptc.nTrajectoryPoints() ) {
4565  continue;
4566  }
4567 
4568  const reco::PFTrajectoryPoint& tp
4569  = ptc.extrapolatedPoint( layer );
4570 
4571  peta = tp.position().Eta();
4572  pphi = tp.position().Phi();
4573  pe = tp.momentum().E();
4574 
4575  double deta = peta - eta;
4576  double dphi = pphi - phi;
4577 
4578  double dist2 = deta*deta + dphi*dphi;
4579 
4580  if(dist2<mindist2) {
4581  mindist2 = dist2;
4582  iClosest = i;
4583  }
4584  }
4585 
4586  return trueParticles_[iClosest];
4587 }
int i
Definition: DBlmapReader.cc:9
const math::XYZPoint & position() const
cartesian position (x, y, z)
T eta() const
reco::PFSimParticleCollection trueParticles_
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:76
true particle for particle flow
Definition: PFSimParticle.h:19
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
unsigned int nTrajectoryMeasurements() const
Definition: PFTrack.h:94
unsigned int nTrajectoryPoints() const
Definition: PFTrack.h:90
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Definition: DDAxes.h:10
void PFRootEventManager::clustering ( )

read data from testbeam tree

performs clustering

Definition at line 2861 of file PFRootEventManager.cc.

References clusterAlgoECAL_, clusterAlgoHCAL_, clusterAlgoHFEM_, clusterAlgoHFHAD_, clusterAlgoHO_, clusterAlgoPS_, PFClusterAlgo::clusters(), clustersECAL_, clustersHCAL_, clustersHFEM_, clustersHFHAD_, clustersHO_, clustersPS_, gather_cfg::cout, PFClusterAlgo::doClustering(), fillOutEventWithClusters(), fillRecHitMask(), rechitsECAL_, rechitsHCAL_, rechitsHFEM_, rechitsHFHAD_, rechitsHO_, rechitsPS_, useHO_, VERBOSE, and verbosity_.

Referenced by processEntry().

2861  {
2862 
2863  if (verbosity_ == VERBOSE ) {
2864  cout <<"start clustering"<<endl;
2865  }
2866 
2867  vector<bool> mask;
2868  // ECAL clustering -------------------------------------------
2869 
2870  fillRecHitMask( mask, rechitsECAL_ );
2873 
2874  assert(clustersECAL_.get() );
2875 
2877 
2878  // HCAL clustering -------------------------------------------
2879 
2880  fillRecHitMask( mask, rechitsHCAL_ );
2883 
2885 
2886  // HO clustering -------------------------------------------
2887 
2888  if (useHO_) {
2889  fillRecHitMask( mask, rechitsHO_ );
2890 
2892 
2894 
2896  }
2897 
2898  // HF clustering -------------------------------------------
2899 
2900  fillRecHitMask( mask, rechitsHFEM_ );
2903 
2904  fillRecHitMask( mask, rechitsHFHAD_ );
2907 
2908  // PS clustering -------------------------------------------
2909 
2910  fillRecHitMask( mask, rechitsPS_ );
2913 
2915 
2916 }
PFClusterAlgo clusterAlgoHFEM_
clustering algorithm for HF, electro-magnetic layer
PFClusterAlgo clusterAlgoHO_
clustering algorithm for HO
void doClustering(const reco::PFRecHitCollection &rechits)
perform clustering
std::auto_ptr< reco::PFClusterCollection > clustersECAL_
reco::PFRecHitCollection rechitsHFHAD_
std::auto_ptr< reco::PFClusterCollection > clustersHCAL_
PFClusterAlgo clusterAlgoECAL_
reco::PFRecHitCollection rechitsPS_
reco::PFRecHitCollection rechitsHCAL_
void fillOutEventWithClusters(const reco::PFClusterCollection &clusters)
fills OutEvent with clusters
std::auto_ptr< reco::PFClusterCollection > clustersPS_
PFClusterAlgo clusterAlgoHCAL_
clustering algorithm for HCAL
std::auto_ptr< reco::PFClusterCollection > clustersHO_
reco::PFRecHitCollection rechitsHFEM_
reco::PFRecHitCollection rechitsHO_
std::auto_ptr< reco::PFClusterCollection > clustersHFEM_
std::auto_ptr< reco::PFClusterCollection > clustersHFHAD_
PFClusterAlgo clusterAlgoPS_
clustering algorithm for PS
std::auto_ptr< std::vector< reco::PFCluster > > & clusters()
bool useHO_
Use of HO in links with tracks/HCAL and in particle flow reconstruction.
reco::PFRecHitCollection rechitsECAL_
tuple cout
Definition: gather_cfg.py:121
int verbosity_
verbosity
PFClusterAlgo clusterAlgoHFHAD_
clustering algorithm for HF, hadronic layer
void fillRecHitMask(std::vector< bool > &mask, const reco::PFRecHitCollection &rechits) const
rechit mask set to true for rechits inside TCutG
void PFRootEventManager::connect ( const char *  infilename = "")

open the root file and connect to the tree

Definition at line 1675 of file PFRootEventManager.cc.

References caloJetsTag_, caloMetsTag_, caloTowersTag_, convBremGsfrecTracksTag_, conversionTag_, corrcaloJetsTag_, gather_cfg::cout, displacedRecTracksTag_, AutoLibraryLoader::enable(), ev_, genJetsTag_, genParticlesforJetsTag_, genParticlesforMETTag_, IO::GetOpt(), gsfrecTracksTag_, compare_using_db::ifile, inFileNames_, fwlite::ChainEvent::isValid(), MCTruthTag_, muonsTag_, options_, pfCandidateTag_, pfJetsTag_, pfMetsTag_, pfNuclearTrackerVertexTag_, photonTag_, primaryVerticesTag_, rechitsCLEANEDHandles_, rechitsCLEANEDTags_, rechitsCLEANEDV_, rechitsECALTag_, rechitsHCALTag_, rechitsHFEMTag_, rechitsHFHADTag_, rechitsHOTag_, rechitsPSTag_, recTracksTag_, fwlite::ChainEvent::size(), stdTracksTag_, AlCaHLTBitMon_QueryRunRegistry::string, o2o::tags, tcMetsTag_, trueParticlesTag_, useConvBremGsfTracks_, useConvBremPFRecTracks_, usePFConversions_, usePFNuclearInteractions_, usePFV0s_, and v0Tag_.

Referenced by Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea::__init__(), Vispa.Views.PropertyView.BooleanProperty::__init__(), Vispa.Gui.FindDialog.FindDialog::_addScript(), Vispa.Gui.FindDialog.FindDialog::_addStringProperty(), Vispa.Main.Application.Application::_connectSignals(), Vispa.Plugins.ConfigEditor.CodeTableView.CodeTableView::_createItem(), Vispa.Gui.BoxContentDialog.BoxContentDialog::addButton(), Vispa.Gui.ToolBoxContainer.ToolBoxContainer::addWidget(), Vispa.Views.PropertyView.PropertyView::append(), Vispa.Views.PropertyView.PropertyView::appendAddRow(), Vispa.Main.Application.Application::createAction(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createButton(), Vispa.Views.LineDecayView.LineDecayView::createLineDecayContainer(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createLineEdit(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.PropertyView.TextEditWithButtonProperty::createTextEdit(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filterDialog(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Gui.PortWidget.PortWidget::mouseMoveEvent(), readOptions(), Vispa.Views.PropertyView.BooleanProperty::setChecked(), Vispa.Main.SplitterTab.SplitterTab::setController(), Vispa.Plugins.Browser.BrowserTab.BrowserTab::setController(), Vispa.Views.PropertyView.BooleanProperty::setReadOnly(), Vispa.Views.PropertyView.DropDownProperty::setReadOnly(), Vispa.Views.PropertyView.TextEditWithButtonProperty::setReadOnly(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setTab(), Vispa.Views.PropertyView.IntegerProperty::setValue(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController::updateViewMenu(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController::updateViewMenu().

1675  {
1676 
1677  cout<<"Opening input root files"<<endl;
1678 
1679  options_->GetOpt("root","file", inFileNames_);
1680 
1681 
1682 
1683  try {
1685  }
1686  catch(string& err) {
1687  cout<<err<<endl;
1688  }
1689 
1691 
1692 
1693  if ( !ev_ || !ev_->isValid() ) {
1694  cout << "The rootfile(s) " << endl;
1695  for ( unsigned int ifile=0; ifile<inFileNames_.size(); ++ifile )
1696  std::cout << " - " << inFileNames_[ifile] << std::endl;
1697  cout << " is (are) not valid file(s) to open" << endl;
1698  return;
1699  } else {
1700  cout << "The rootfile(s) : " << endl;
1701  for ( unsigned int ifile=0; ifile<inFileNames_.size(); ++ifile )
1702  std::cout << " - " << inFileNames_[ifile] << std::endl;
1703  cout<<" are opened with " << ev_->size() << " events." <<endl;
1704  }
1705 
1706  // hits branches ----------------------------------------------
1707  std::string rechitsECALtagname;
1708  options_->GetOpt("root","rechits_ECAL_inputTag", rechitsECALtagname);
1709  rechitsECALTag_ = edm::InputTag(rechitsECALtagname);
1710 
1711  std::string rechitsHCALtagname;
1712  options_->GetOpt("root","rechits_HCAL_inputTag", rechitsHCALtagname);
1713  rechitsHCALTag_ = edm::InputTag(rechitsHCALtagname);
1714 
1715  std::string rechitsHOtagname;
1716  options_->GetOpt("root","rechits_HO_inputTag", rechitsHOtagname);
1717  rechitsHOTag_ = edm::InputTag(rechitsHOtagname);
1718 
1719  std::string rechitsHFEMtagname;
1720  options_->GetOpt("root","rechits_HFEM_inputTag", rechitsHFEMtagname);
1721  rechitsHFEMTag_ = edm::InputTag(rechitsHFEMtagname);
1722 
1723  std::string rechitsHFHADtagname;
1724  options_->GetOpt("root","rechits_HFHAD_inputTag", rechitsHFHADtagname);
1725  rechitsHFHADTag_ = edm::InputTag(rechitsHFHADtagname);
1726 
1727  std::vector<string> rechitsCLEANEDtagnames;
1728  options_->GetOpt("root","rechits_CLEANED_inputTags", rechitsCLEANEDtagnames);
1729  for ( unsigned tags = 0; tags<rechitsCLEANEDtagnames.size(); ++tags )
1730  rechitsCLEANEDTags_.push_back(edm::InputTag(rechitsCLEANEDtagnames[tags]));
1731  rechitsCLEANEDV_.resize(rechitsCLEANEDTags_.size());
1733 
1734 
1735  // Tracks branches
1736  std::string rechitsPStagname;
1737  options_->GetOpt("root","rechits_PS_inputTag", rechitsPStagname);
1738  rechitsPSTag_ = edm::InputTag(rechitsPStagname);
1739 
1740  std::string recTrackstagname;
1741  options_->GetOpt("root","recTracks_inputTag", recTrackstagname);
1742  recTracksTag_ = edm::InputTag(recTrackstagname);
1743 
1744  std::string displacedRecTrackstagname;
1745  options_->GetOpt("root","displacedRecTracks_inputTag", displacedRecTrackstagname);
1746  displacedRecTracksTag_ = edm::InputTag(displacedRecTrackstagname);
1747 
1748  std::string primaryVerticestagname;
1749  options_->GetOpt("root","primaryVertices_inputTag", primaryVerticestagname);
1750  primaryVerticesTag_ = edm::InputTag(primaryVerticestagname);
1751 
1752  std::string stdTrackstagname;
1753  options_->GetOpt("root","stdTracks_inputTag", stdTrackstagname);
1754  stdTracksTag_ = edm::InputTag(stdTrackstagname);
1755 
1756  std::string gsfrecTrackstagname;
1757  options_->GetOpt("root","gsfrecTracks_inputTag", gsfrecTrackstagname);
1758  gsfrecTracksTag_ = edm::InputTag(gsfrecTrackstagname);
1759 
1760  useConvBremGsfTracks_ = false;
1761  options_->GetOpt("particle_flow", "useConvBremGsfTracks", useConvBremGsfTracks_);
1762  if ( useConvBremGsfTracks_ ) {
1763  std::string convBremGsfrecTrackstagname;
1764  options_->GetOpt("root","convBremGsfrecTracks_inputTag", convBremGsfrecTrackstagname);
1765  convBremGsfrecTracksTag_ = edm::InputTag(convBremGsfrecTrackstagname);
1766  }
1767 
1768  useConvBremPFRecTracks_ = false;
1769  options_->GetOpt("particle_flow", "useConvBremPFRecTracks", useConvBremPFRecTracks_);
1770 
1771 
1772  // muons branch
1773  std::string muonstagname;
1774  options_->GetOpt("root","muon_inputTag", muonstagname);
1775  muonsTag_ = edm::InputTag(muonstagname);
1776 
1777  // conversion
1778  usePFConversions_=false;
1779  options_->GetOpt("particle_flow", "usePFConversions", usePFConversions_);
1780  if( usePFConversions_ ) {
1781  std::string conversiontagname;
1782  options_->GetOpt("root","conversion_inputTag", conversiontagname);
1783  conversionTag_ = edm::InputTag(conversiontagname);
1784  }
1785 
1786  // V0
1787  usePFV0s_=false;
1788  options_->GetOpt("particle_flow", "usePFV0s", usePFV0s_);
1789  if( usePFV0s_ ) {
1790  std::string v0tagname;
1791  options_->GetOpt("root","V0_inputTag", v0tagname);
1792  v0Tag_ = edm::InputTag(v0tagname);
1793  }
1794 
1795  // Photons
1796  std::string photontagname;
1797  options_->GetOpt("root","Photon_inputTag",photontagname);
1798  photonTag_ = edm::InputTag(photontagname);
1799 
1800  //Displaced Vertices
1802  options_->GetOpt("particle_flow", "usePFNuclearInteractions", usePFNuclearInteractions_);
1804  std::string pfNuclearTrackerVertextagname;
1805  options_->GetOpt("root","PFDisplacedVertex_inputTag", pfNuclearTrackerVertextagname);
1806  pfNuclearTrackerVertexTag_ = edm::InputTag(pfNuclearTrackerVertextagname);
1807  }
1808 
1809  std::string trueParticlestagname;
1810  options_->GetOpt("root","trueParticles_inputTag", trueParticlestagname);
1811  trueParticlesTag_ = edm::InputTag(trueParticlestagname);
1812 
1813  std::string MCTruthtagname;
1814  options_->GetOpt("root","MCTruth_inputTag", MCTruthtagname);
1815  MCTruthTag_ = edm::InputTag(MCTruthtagname);
1816 
1817  std::string caloTowerstagname;
1818  options_->GetOpt("root","caloTowers_inputTag", caloTowerstagname);
1819  caloTowersTag_ = edm::InputTag(caloTowerstagname);
1820 
1821  std::string genJetstagname;
1822  options_->GetOpt("root","genJets_inputTag", genJetstagname);
1823  genJetsTag_ = edm::InputTag(genJetstagname);
1824 
1825 
1826  std::string genParticlesforMETtagname;
1827  options_->GetOpt("root","genParticlesforMET_inputTag", genParticlesforMETtagname);
1828  genParticlesforMETTag_ = edm::InputTag(genParticlesforMETtagname);
1829 
1830  std::string genParticlesforJetstagname;
1831  options_->GetOpt("root","genParticlesforJets_inputTag", genParticlesforJetstagname);
1832  genParticlesforJetsTag_ = edm::InputTag(genParticlesforJetstagname);
1833 
1834  // PF candidates
1835  std::string pfCandidatetagname;
1836  options_->GetOpt("root","particleFlowCand_inputTag", pfCandidatetagname);
1837  pfCandidateTag_ = edm::InputTag(pfCandidatetagname);
1838 
1839  std::string caloJetstagname;
1840  options_->GetOpt("root","CaloJets_inputTag", caloJetstagname);
1841  caloJetsTag_ = edm::InputTag(caloJetstagname);
1842 
1843  std::string corrcaloJetstagname;
1844  options_->GetOpt("root","corrCaloJets_inputTag", corrcaloJetstagname);
1845  corrcaloJetsTag_ = edm::InputTag(corrcaloJetstagname);
1846 
1847  std::string pfJetstagname;
1848  options_->GetOpt("root","PFJets_inputTag", pfJetstagname);
1849  pfJetsTag_ = edm::InputTag(pfJetstagname);
1850 
1851  std::string pfMetstagname;
1852  options_->GetOpt("root","PFMET_inputTag", pfMetstagname);
1853  pfMetsTag_ = edm::InputTag(pfMetstagname);
1854 
1855  std::string caloMetstagname;
1856  options_->GetOpt("root","CaloMET_inputTag", caloMetstagname);
1857  caloMetsTag_ = edm::InputTag(caloMetstagname);
1858 
1859  std::string tcMetstagname;
1860  options_->GetOpt("root","TCMET_inputTag", tcMetstagname);
1861  tcMetsTag_ = edm::InputTag(tcMetstagname);
1862 
1863 }
edm::InputTag displacedRecTracksTag_
edm::InputTag MCTruthTag_
bool useConvBremPFRecTracks_
Use Conv Brem KF Tracks.
edm::InputTag caloJetsTag_
Long64_t size() const
Definition: ChainEvent.cc:311
edm::InputTag convBremGsfrecTracksTag_
fwlite::ChainEvent * ev_
NEW: input event.
IO * options_
options file parser
bool usePFV0s_
Use of V0 in PFAlgo.
edm::InputTag stdTracksTag_
std::vector< std::string > inFileNames_
input file names
edm::InputTag photonTag_
edm::InputTag primaryVerticesTag_
edm::InputTag rechitsHFEMTag_
edm::InputTag rechitsECALTag_
bool usePFNuclearInteractions_
Use of PFDisplacedVertex in PFAlgo.
edm::InputTag pfMetsTag_
bool GetOpt(const char *tag, const char *key, std::vector< T > &values) const
reads a vector of T
Definition: IO.h:106
edm::InputTag gsfrecTracksTag_
std::vector< edm::Handle< reco::PFRecHitCollection > > rechitsCLEANEDHandles_
edm::InputTag rechitsPSTag_
edm::InputTag genParticlesforMETTag_
edm::InputTag rechitsHOTag_
edm::InputTag pfNuclearTrackerVertexTag_
edm::InputTag corrcaloJetsTag_
edm::InputTag genParticlesforJetsTag_
edm::InputTag caloTowersTag_
edm::InputTag recTracksTag_
edm::InputTag genJetsTag_
bool usePFConversions_
Use of conversions in PFAlgo.
edm::InputTag pfJetsTag_
std::vector< reco::PFRecHitCollection > rechitsCLEANEDV_
rechits HF CLEANED
edm::InputTag rechitsHFHADTag_
tuple tags
Definition: o2o.py:248
edm::InputTag caloMetsTag_
edm::InputTag rechitsHCALTag_
edm::InputTag conversionTag_
bool useConvBremGsfTracks_
Use Secondary Gsf Tracks.
static void enable()
enable automatic library loading
edm::InputTag pfCandidateTag_
tuple cout
Definition: gather_cfg.py:121
edm::InputTag tcMetsTag_
bool isValid() const
Definition: ChainEvent.cc:292
std::vector< edm::InputTag > rechitsCLEANEDTags_
edm::InputTag trueParticlesTag_
bool PFRootEventManager::countChargedAndPhotons ( ) const

study the sim event to check if the number of stable charged particles and stable photons match the selection

Definition at line 2645 of file PFRootEventManager.cc.

References abs, DeDxDiscriminatorTools::charge(), reco::PFTrack::charge(), reco::PFSimParticle::daughterIds(), alignCSCRings::e, filterTaus_, i, reco::tau::helpers::nCharged(), reco::PFSimParticle::pdgCode(), and trueParticles_.

Referenced by readFromSimulation().

2645  {
2646 
2647  int nPhoton = 0;
2648  int nCharged = 0;
2649 
2650  for ( unsigned i=0; i < trueParticles_.size(); i++) {
2651  const reco::PFSimParticle& ptc = trueParticles_[i];
2652 
2653  const std::vector<int>& daughters = ptc.daughterIds();
2654 
2655  // if the particle decays before ECAL, we do not want to
2656  // consider it.
2657  if(!daughters.empty() ) continue;
2658 
2659  double charge = ptc.charge();
2660  double pdgCode = ptc.pdgCode();
2661 
2662  if( std::abs(charge)>1e-9)
2663  nCharged++;
2664  else if( pdgCode==22 )
2665  nPhoton++;
2666  }
2667 
2668  // const HepMC::GenEvent* myGenEvent = MCTruth_.GetEvent();
2669  // if(!myGenEvent) {
2670  // cerr<<"impossible to filter on the number of charged and "
2671  // <<"neutral particles without the HepMCProduct. "
2672  // <<"Please check that the branch edmHepMCProduct_*_*_* is found"<<endl;
2673  // exit(1);
2674  // }
2675 
2676  // for ( HepMC::GenEvent::particle_const_iterator
2677  // piter = myGenEvent->particles_begin();
2678  // piter != myGenEvent->particles_end();
2679  // ++piter ) {
2680 
2681  // const HepMC::GenParticle* p = *piter;
2682  // int partId = p->pdg_id();Long64_t lines = T->ReadFile("mon_fichier","i:j:k:x:y:z");
2683 
2684  // // pdgTable_->GetParticle( partId )->Print();
2685 
2686  // int charge = chargeValue(partId);
2687  // cout<<partId <<" "<<charge/3.<<endl;
2688 
2689  // if(charge)
2690  // nCharged++;
2691  // else
2692  // nNeutral++;
2693  // }
2694 
2695  if( nCharged == filterTaus_[0] &&
2696  nPhoton == filterTaus_[1] )
2697  return true;
2698  else
2699  return false;
2700 }
const std::vector< int > & daughterIds() const
Definition: PFSimParticle.h:44
int i
Definition: DBlmapReader.cc:9
#define abs(x)
Definition: mlp_lapack.h:159
int pdgCode() const
Definition: PFSimParticle.h:35
double charge(const std::vector< uint8_t > &Ampls)
reco::PFSimParticleCollection trueParticles_
std::vector< int > filterTaus_
true particle for particle flow
Definition: PFSimParticle.h:19
unsigned int nCharged(const GenJet &jet)
double charge() const
Definition: PFTrack.h:87
bool PFRootEventManager::eventAccepted ( ) const

returns true if the event is accepted(have a look at the function implementation)

Definition at line 2177 of file PFRootEventManager.cc.

Referenced by processEntry().

2177  {
2178  // return highPtJet(10);
2179  //return highPtPFCandidate( 10, PFCandidate::h );
2180  return true;
2181 }
int PFRootEventManager::eventNumber ( )
inline
int PFRootEventManager::eventToEntry ( int  run,
int  lumi,
int  event 
) const

Definition at line 1914 of file PFRootEventManager.cc.

References gather_cfg::cout, and mapEventToEntry_.

Referenced by processEvent().

1914  {
1915 
1916  RunsMap::const_iterator iR = mapEventToEntry_.find( run );
1917  if( iR != mapEventToEntry_.end() ) {
1918  LumisMap::const_iterator iL = iR->second.find( lumi );
1919  if( iL != iR->second.end() ) {
1920  EventToEntry::const_iterator iE = iL->second.find( event );
1921  if( iE != iL->second.end() ) {
1922  return iE->second;
1923  }
1924  else {
1925  cout<<"event "<<event<<" not found in run "<<run<<", lumi "<<lumi<<endl;
1926  }
1927  }
1928  else {
1929  cout<<"lumi "<<lumi<<" not found in run "<<run<<endl;
1930  }
1931  }
1932  else{
1933  cout<<"run "<<run<<" not found"<<endl;
1934  }
1935  return -1;
1936 }
tuple lumi
Definition: fjr2json.py:35
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
tuple cout
Definition: gather_cfg.py:121
string PFRootEventManager::expand ( const std::string &  oldString) const

Definition at line 3816 of file PFRootEventManager.cc.

References begin, dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, createBeamHaloJobs::directory, end, cmsRelvalreport::exit, pickleFileParser::slash, VERBOSE, and verbosity_.

Referenced by readOptions().

3816  {
3817 
3818  string newString = oldString;
3819 
3820  string dollar = "$";
3821  string slash = "/";
3822 
3823  // protection necessary or segv !!
3824  int dollarPos = newString.find(dollar,0);
3825  if( dollarPos == -1 ) return oldString;
3826 
3827  int lengh = newString.find(slash,0) - newString.find(dollar,0) + 1;
3828  string env_variable =
3829  newString.substr( ( newString.find(dollar,0) + 1 ), lengh -2);
3830  // the env var could be defined between { }
3831  int begin = env_variable.find_first_of("{");
3832  int end = env_variable.find_last_of("}");
3833 
3834  // cout << "var=" << env_variable << begin<<" "<<end<< endl;
3835 
3836 
3837  env_variable = env_variable.substr( begin+1, end-1 );
3838  // cout << "var=" << env_variable <<endl;
3839 
3840 
3841  // cerr<<"call getenv "<<endl;
3842  char* directory = getenv( env_variable.c_str() );
3843 
3844  if(!directory) {
3845  cerr<<"please define environment variable $"<<env_variable<<endl;
3846  delete this;
3847  exit(1);
3848  }
3849  string sdir = directory;
3850  sdir += "/";
3851 
3852  newString.replace( 0, lengh , sdir);
3853 
3854  if (verbosity_ == VERBOSE ) {
3855  cout << "expand " <<oldString<<" to "<< newString << endl;
3856  }
3857 
3858  return newString;
3859 }
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
tuple cout
Definition: gather_cfg.py:121
int verbosity_
verbosity
void PFRootEventManager::fillClusterMask ( std::vector< bool > &  mask,
const reco::PFClusterCollection clusters 
) const

cluster mask set to true for rechits inside TCutG

Definition at line 4462 of file PFRootEventManager.cc.

References eta(), i, and phi.

Referenced by particleFlow().

4464  {
4465 
4466  TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
4467  if(!cutg) return;
4468 
4469  mask.clear();
4470  mask.reserve( clusters.size() );
4471  for(unsigned i=0; i<clusters.size(); i++) {
4472 
4473  double eta = clusters[i].position().Eta();
4474  double phi = clusters[i].position().Phi();
4475 
4476  if( cutg->IsInside( eta, phi ) )
4477  mask.push_back( true );
4478  else
4479  mask.push_back( false );
4480  }
4481 }
int i
Definition: DBlmapReader.cc:9
T eta() const
Definition: DDAxes.h:10
void PFRootEventManager::fillOutEventWithBlocks ( const reco::PFBlockCollection blocks)

fills outEvent with blocks

Definition at line 3062 of file PFRootEventManager.cc.

References EventColin::addBlock(), i, and outEvent_.

3063  {
3064 
3065  if(!outEvent_) return;
3066 
3067  for ( unsigned i=0; i < blocks.size(); i++) {
3068 
3069  // const reco::PFBlock& block = blocks[i];
3070 
3071  EventColin::Block outblock;
3072 
3073  outEvent_->addBlock( outblock );
3074  }
3075 }
const reco::PFBlockCollection & blocks() const
int i
Definition: DBlmapReader.cc:9
void addBlock(const Block &b)
Definition: EventColin.h:116
void PFRootEventManager::fillOutEventWithCaloTowers ( const CaloTowerCollection cts)

fills outEvent with calo towers

Definition at line 3043 of file PFRootEventManager.cc.

References EventColin::addCaloTower(), EventColin::CaloTower::e, EventColin::CaloTower::ee, EventColin::CaloTower::eh, CaloTower::emEnergy(), reco::LeafCandidate::energy(), CaloTower::hadEnergy(), i, outEvent_, and edm::SortedCollection< T, SORT >::size().

3043  {
3044 
3045  if(!outEvent_) return;
3046 
3047  for ( unsigned i=0; i < cts.size(); i++) {
3048 
3049  const CaloTower& ct = cts[i];
3050 
3051  EventColin::CaloTower outct;
3052  outct.e = ct.energy();
3053  outct.ee = ct.emEnergy();
3054  outct.eh = ct.hadEnergy();
3055 
3056  outEvent_->addCaloTower( outct );
3057  }
3058 }
virtual double energy() const GCC11_FINAL
energy
int i
Definition: DBlmapReader.cc:9
double emEnergy() const
Definition: CaloTower.h:79
double hadEnergy() const
Definition: CaloTower.h:80
size_type size() const
void addCaloTower(const CaloTower &ct)
Definition: EventColin.h:112
void PFRootEventManager::fillOutEventWithClusters ( const reco::PFClusterCollection clusters)

fills OutEvent with clusters

Definition at line 2921 of file PFRootEventManager.cc.

References EventColin::addCluster(), closestParticle(), EventColin::Particle::e, EventColin::Cluster::e, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, reco::PFTrajectoryPoint::ECALEntrance, EventColin::Particle::eta, EventColin::Cluster::eta, cppFunctionSkipper::exception, PFLayer::HCAL_BARREL1, PFLayer::HCAL_BARREL2, PFLayer::HCAL_ENDCAP, reco::PFTrajectoryPoint::HCALEntrance, reco::PFTrajectoryPoint::HOLayer, i, EventColin::Cluster::layer, reco::PFTrajectoryPoint::NLayers, outEvent_, EventColin::Cluster::particle, EventColin::Particle::pdgCode, reco::PFSimParticle::pdgCode(), phi, EventColin::Particle::phi, EventColin::Cluster::phi, EventColin::Cluster::type, and useHO_.

Referenced by clustering().

2922  {
2923 
2924  if(!outEvent_) return;
2925 
2926  for(unsigned i=0; i<clusters.size(); i++) {
2927  EventColin::Cluster cluster;
2928  cluster.eta = clusters[i].position().Eta();
2929  cluster.phi = clusters[i].position().Phi();
2930  cluster.e = clusters[i].energy();
2931  cluster.layer = clusters[i].layer();
2932  if (!useHO_ && cluster.layer==PFLayer::HCAL_BARREL2) continue;
2933  cluster.type = 1;
2934 
2937  switch( clusters[i].layer() ) {
2938  case PFLayer::ECAL_BARREL:
2939  case PFLayer::ECAL_ENDCAP:
2941  break;
2942  case PFLayer::HCAL_BARREL1:
2943  case PFLayer::HCAL_ENDCAP:
2945  break;
2946 
2947  case PFLayer::HCAL_BARREL2:
2949  break;
2950 
2951  default:
2952  break;
2953  }
2954  if(tpLayer < reco::PFTrajectoryPoint::NLayers) {
2955  try {
2956  double peta = -10;
2957  double phi = -10;
2958  double pe = -10;
2959 
2960  const reco::PFSimParticle& ptc
2961  = closestParticle( tpLayer,
2962  cluster.eta, cluster.phi,
2963  peta, phi, pe );
2964 
2965 
2966  cluster.particle.eta = peta;
2967  cluster.particle.phi = phi;
2968  cluster.particle.e = pe;
2969  cluster.particle.pdgCode = ptc.pdgCode();
2970 
2971 
2972  }
2973  catch( std::exception& err ) {
2974  // cerr<<err.what()<<endl;
2975  }
2976  }
2977 
2978  outEvent_->addCluster(cluster);
2979  }
2980 }
int i
Definition: DBlmapReader.cc:9
int pdgCode() const
Definition: PFSimParticle.h:35
void addCluster(const Cluster &ptc)
Definition: EventColin.h:92
true particle for particle flow
Definition: PFSimParticle.h:19
const reco::PFSimParticle & closestParticle(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
bool useHO_
Use of HO in links with tracks/HCAL and in particle flow reconstruction.
LayerType
Define the different layers where the track can be propagated.
Definition: DDAxes.h:10
void PFRootEventManager::fillOutEventWithPFCandidates ( const reco::PFCandidateCollection pfCandidates)

fills OutEvent with candidates

Definition at line 3022 of file PFRootEventManager.cc.

References EventColin::addCandidate(), EventColin::Particle::e, reco::LeafCandidate::energy(), EventColin::Particle::eta, reco::LeafCandidate::eta(), i, outEvent_, reco::PFCandidate::particleId(), EventColin::Particle::pdgCode, EventColin::Particle::phi, and reco::LeafCandidate::phi().

Referenced by particleFlow().

3022  {
3023 
3024  if(!outEvent_) return;
3025 
3026  for ( unsigned i=0; i < pfCandidates.size(); i++) {
3027 
3028  const reco::PFCandidate& candidate = pfCandidates[i];
3029 
3030  EventColin::Particle outptc;
3031  outptc.eta = candidate.eta();
3032  outptc.phi = candidate.phi();
3033  outptc.e = candidate.energy();
3034  outptc.pdgCode = candidate.particleId();
3035 
3036 
3037  outEvent_->addCandidate(outptc);
3038  }
3039 }
virtual double energy() const GCC11_FINAL
energy
int i
Definition: DBlmapReader.cc:9
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
void addCandidate(const Particle &ptc)
Definition: EventColin.h:88
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
virtual ParticleType particleId() const
Definition: PFCandidate.h:347
void PFRootEventManager::fillOutEventWithSimParticles ( const reco::PFSimParticleCollection ptcs)

fills OutEvent with sim particles

Definition at line 2984 of file PFRootEventManager.cc.

References EventColin::addParticle(), reco::PFSimParticle::daughterIds(), EventColin::Particle::e, reco::PFTrajectoryPoint::ECALEntrance, EventColin::Particle::eta, reco::PFTrack::extrapolatedPoint(), i, reco::PFTrajectoryPoint::momentum(), reco::PFTrack::nTrajectoryPoints(), outEvent_, EventColin::Particle::pdgCode, reco::PFSimParticle::pdgCode(), EventColin::Particle::phi, and reco::PFTrajectoryPoint::position().

Referenced by readFromSimulation().

2984  {
2985 
2986  if(!outEvent_) return;
2987 
2988  for ( unsigned i=0; i < trueParticles.size(); i++) {
2989 
2990  const reco::PFSimParticle& ptc = trueParticles[i];
2991 
2992  unsigned ntrajpoints = ptc.nTrajectoryPoints();
2993 
2994  if(ptc.daughterIds().empty() ) { // stable
2997 
2998  if(ntrajpoints == 3) {
2999  // old format for PFSimCandidates.
3000  // in this case, the PFSimCandidate which does not decay
3001  // before ECAL has 3 points: initial, ecal entrance, hcal entrance
3002  ecalEntrance = static_cast<reco::PFTrajectoryPoint::LayerType>(1);
3003  }
3004  // else continue; // endcap case we do not care;
3005 
3006  const reco::PFTrajectoryPoint& tpatecal
3007  = ptc.extrapolatedPoint( ecalEntrance );
3008 
3009  EventColin::Particle outptc;
3010  outptc.eta = tpatecal.position().Eta();
3011  outptc.phi = tpatecal.position().Phi();
3012  outptc.e = tpatecal.momentum().E();
3013  outptc.pdgCode = ptc.pdgCode();
3014 
3015 
3016  outEvent_->addParticle(outptc);
3017  }
3018  }
3019 }
const std::vector< int > & daughterIds() const
Definition: PFSimParticle.h:44
int i
Definition: DBlmapReader.cc:9
const math::XYZPoint & position() const
cartesian position (x, y, z)
int pdgCode() const
Definition: PFSimParticle.h:35
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:76
true particle for particle flow
Definition: PFSimParticle.h:19
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
void addParticle(const Particle &ptc)
Definition: EventColin.h:84
unsigned int nTrajectoryPoints() const
Definition: PFTrack.h:90
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
LayerType
Define the different layers where the track can be propagated.
void PFRootEventManager::fillPhotonMask ( std::vector< bool > &  mask,
const reco::PhotonCollection photons 
) const

photon mask set to true for photons inside TCutG

Definition at line 4502 of file PFRootEventManager.cc.

References eta(), i, and phi.

Referenced by particleFlow().

4504  {
4505 
4506  TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
4507  if(!cutg) return;
4508 
4509  mask.clear();
4510  mask.reserve( photons.size() );
4511  for(unsigned i=0; i<photons.size(); i++) {
4512  double eta = photons[i].caloPosition().Eta();
4513  double phi = photons[i].caloPosition().Phi();
4514  if( cutg->IsInside( eta, phi ) )
4515  mask.push_back( true );
4516  else
4517  mask.push_back( false );
4518  }
4519 }
int i
Definition: DBlmapReader.cc:9
T eta() const
Definition: DDAxes.h:10
void PFRootEventManager::fillRecHitMask ( std::vector< bool > &  mask,
const reco::PFRecHitCollection rechits 
) const

rechit mask set to true for rechits inside TCutG

Definition at line 4437 of file PFRootEventManager.cc.

References eta(), i, and phi.

Referenced by clustering().

4439  {
4440 
4441  TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
4442  if(!cutg) {
4443  mask.resize( rechits.size(), true);
4444  return;
4445  }
4446 
4447  mask.clear();
4448  mask.reserve( rechits.size() );
4449  for(unsigned i=0; i<rechits.size(); i++) {
4450 
4451  double eta = rechits[i].position().Eta();
4452  double phi = rechits[i].position().Phi();
4453 
4454  if( cutg->IsInside( eta, phi ) )
4455  mask.push_back( true );
4456  else
4457  mask.push_back( false );
4458  }
4459 }
int i
Definition: DBlmapReader.cc:9
T eta() const
Definition: DDAxes.h:10
void PFRootEventManager::fillTrackMask ( std::vector< bool > &  mask,
const reco::PFRecTrackCollection tracks 
) const

track mask set to true for rechits inside TCutG

Definition at line 4484 of file PFRootEventManager.cc.

References i, and trackInsideGCut().

Referenced by particleFlow().

4486  {
4487 
4488  TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
4489  if(!cutg) return;
4490 
4491  mask.clear();
4492  mask.reserve( tracks.size() );
4493  for(unsigned i=0; i<tracks.size(); i++) {
4494  if( trackInsideGCut( tracks[i] ) )
4495  mask.push_back( true );
4496  else
4497  mask.push_back( false );
4498  }
4499 }
int i
Definition: DBlmapReader.cc:9
tuple tracks
Definition: testEve_cfg.py:39
bool trackInsideGCut(const reco::PFTrack &track) const
is PFTrack inside cut G ? yes if at least one trajectory point is inside.
void PFRootEventManager::fillTrackMask ( std::vector< bool > &  mask,
const reco::GsfPFRecTrackCollection tracks 
) const

Definition at line 4523 of file PFRootEventManager.cc.

References i, and trackInsideGCut().

4525  {
4526 
4527  TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
4528  if(!cutg) return;
4529 
4530  mask.clear();
4531  mask.reserve( tracks.size() );
4532  for(unsigned i=0; i<tracks.size(); i++) {
4533  if( trackInsideGCut( tracks[i] ) )
4534  mask.push_back( true );
4535  else
4536  mask.push_back( false );
4537  }
4538 }
int i
Definition: DBlmapReader.cc:9
tuple tracks
Definition: testEve_cfg.py:39
bool trackInsideGCut(const reco::PFTrack &track) const
is PFTrack inside cut G ? yes if at least one trajectory point is inside.
std::string PFRootEventManager::getGenParticleName ( int  partId,
std::string &  latexStringName 
) const

get name of genParticle

Definition at line 4609 of file PFRootEventManager.cc.

References gather_cfg::cout, mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DisplayManager::createGGenParticle(), and printGenParticles().

4610 {
4611  std::string name;
4612  switch(partId) {
4613  case 1: { name = "d";latexString="d"; break; }
4614  case 2: { name = "u";latexString="u";break; }
4615  case 3: { name = "s";latexString="s" ;break; }
4616  case 4: { name = "c";latexString="c" ; break; }
4617  case 5: { name = "b";latexString="b" ; break; }
4618  case 6: { name = "t";latexString="t" ; break; }
4619  case -1: { name = "~d";latexString="#bar{d}" ; break; }
4620  case -2: { name = "~u";latexString="#bar{u}" ; break; }
4621  case -3: { name = "~s";latexString="#bar{s}" ; break; }
4622  case -4: { name = "~c";latexString="#bar{c}" ; break; }
4623  case -5: { name = "~b";latexString="#bar{b}" ; break; }
4624  case -6: { name = "~t";latexString="#bar{t}" ; break; }
4625  case 11: { name = "e-";latexString=name ; break; }
4626  case -11: { name = "e+";latexString=name ; break; }
4627  case 12: { name = "nu_e";latexString="#nu_{e}" ; break; }
4628  case -12: { name = "~nu_e";latexString="#bar{#nu}_{e}" ; break; }
4629  case 13: { name = "mu-";latexString="#mu-" ; break; }
4630  case -13: { name = "mu+";latexString="#mu+" ; break; }
4631  case 14: { name = "nu_mu";latexString="#nu_{mu}" ; break; }
4632  case -14: { name = "~nu_mu";latexString="#bar{#nu}_{#mu}"; break; }
4633  case 15: { name = "tau-";latexString="#tau^{-}" ; break; }
4634  case -15: { name = "tau+";latexString="#tau^{+}" ; break; }
4635  case 16: { name = "nu_tau";latexString="#nu_{#tau}" ; break; }
4636  case -16: { name = "~nu_tau";latexString="#bar{#nu}_{#tau}"; break; }
4637  case 21: { name = "gluon";latexString= name; break; }
4638  case 22: { name = "gamma";latexString= "#gamma"; break; }
4639  case 23: { name = "Z0";latexString="Z^{0}" ; break; }
4640  case 24: { name = "W+";latexString="W^{+}" ; break; }
4641  case 25: { name = "H0";latexString=name ; break; }
4642  case -24: { name = "W-";latexString="W^{-}" ; break; }
4643  case 111: { name = "pi0";latexString="#pi^{0}" ; break; }
4644  case 113: { name = "rho0";latexString="#rho^{0}" ; break; }
4645  case 223: { name = "omega";latexString="#omega" ; break; }
4646  case 333: { name = "phi";latexString= "#phi"; break; }
4647  case 443: { name = "J/psi";latexString="J/#psi" ; break; }
4648  case 553: { name = "Upsilon";latexString="#Upsilon" ; break; }
4649  case 130: { name = "K0L";latexString=name ; break; }
4650  case 211: { name = "pi+";latexString="#pi^{+}" ; break; }
4651  case -211: { name = "pi-";latexString="#pi^{-}" ; break; }
4652  case 213: { name = "rho+";latexString="#rho^{+}" ; break; }
4653  case -213: { name = "rho-";latexString="#rho^{-}" ; break; }
4654  case 221: { name = "eta";latexString="#eta" ; break; }
4655  case 331: { name = "eta'";latexString="#eta'" ; break; }
4656  case 441: { name = "etac";latexString="#eta_{c}" ; break; }
4657  case 551: { name = "etab";latexString= "#eta_{b}"; break; }
4658  case 310: { name = "K0S";latexString=name ; break; }
4659  case 311: { name = "K0";latexString="K^{0}" ; break; }
4660  case -311: { name = "Kbar0";latexString="#bar{#Kappa}^{0}" ; break; }
4661  case 321: { name = "K+";latexString= "K^{+}"; break; }
4662  case -321: { name = "K-";latexString="K^{-}"; break; }
4663  case 411: { name = "D+";latexString="D^{+}" ; break; }
4664  case -411: { name = "D-";latexString="D^{-}"; break; }
4665  case 421: { name = "D0";latexString="D^{0}" ; break; }
4666  case -421: { name = "D0-bar";latexString="#overline{D^{0}}" ; break; }
4667  case 423: { name = "D*0";latexString="D^{*0}" ; break; }
4668  case -423: { name = "D*0-bar";latexString="#overline{D^{*0}}" ; break; }
4669  case 431: { name = "Ds_+";latexString="Ds_{+}" ; break; }
4670  case -431: { name = "Ds_-";latexString="Ds_{-}" ; break; }
4671  case 511: { name = "B0";latexString= name; break; }
4672  case 521: { name = "B+";latexString="B^{+}" ; break; }
4673  case -521: { name = "B-";latexString="B^{-}" ; break; }
4674  case 531: { name = "Bs_0";latexString="Bs_{0}" ; break; }
4675  case -531: { name = "anti-Bs_0";latexString="#overline{Bs_{0}}" ; break; }
4676  case 541: { name = "Bc_+";latexString="Bc_{+}" ; break; }
4677  case -541: { name = "Bc_+";latexString="Bc_{+}" ; break; }
4678  case 313: { name = "K*0";latexString="K^{*0}" ; break; }
4679  case -313: { name = "K*bar0";latexString="#bar{K}^{*0}" ; break; }
4680  case 323: { name = "K*+";latexString="#K^{*+}"; break; }
4681  case -323: { name = "K*-";latexString="#K^{*-}" ; break; }
4682  case 413: { name = "D*+";latexString= "D^{*+}"; break; }
4683  case -413: { name = "D*-";latexString= "D^{*-}" ; break; }
4684 
4685  case 433: { name = "Ds*+";latexString="D_{s}^{*+}" ; break; }
4686  case -433: { name = "Ds*-";latexString="B_{S}{*-}" ; break; }
4687 
4688  case 513: { name = "B*0";latexString="B^{*0}" ; break; }
4689  case -513: { name = "anti-B*0";latexString="#overline{B^{*0}}" ; break; }
4690  case 523: { name = "B*+";latexString="B^{*+}" ; break; }
4691  case -523: { name = "B*-";latexString="B^{*-}" ; break; }
4692 
4693  case 533: { name = "B*_s0";latexString="B^{*}_{s0}" ; break; }
4694  case -533 : {name="anti-B_s0"; latexString= "#overline{B_{s}^{0}}";break; }
4695 
4696  case 543: { name = "B*_c+";latexString= "B^{*}_{c+}"; break; }
4697  case -543: { name = "B*_c-";latexString= "B^{*}_{c-}"; break; }
4698  case 1114: { name = "Delta-";latexString="#Delta^{-}" ; break; }
4699  case -1114: { name = "Deltabar+";latexString="#bar{#Delta}^{+}" ; break; }
4700  case -2112: { name = "nbar0";latexString="{bar}n^{0}" ; break; }
4701  case 2112: { name = "n"; latexString=name ;break;}
4702  case 2114: { name = "Delta0"; latexString="#Delta^{0}" ;break; }
4703  case -2114: { name = "Deltabar0"; latexString="#bar{#Delta}^{0}" ;break; }
4704  case 3122: { name = "Lambda0";latexString= "#Lambda^{0}"; break; }
4705  case -3122: { name = "Lambdabar0";latexString="#bar{#Lambda}^{0}" ; break; }
4706  case 3112: { name = "Sigma-"; latexString="#Sigma" ;break; }
4707  case -3112: { name = "Sigmabar+"; latexString="#bar{#Sigma}^{+}" ;break; }
4708  case 3114: { name = "Sigma*-"; latexString="#Sigma^{*}" ;break; }
4709  case -3114: { name = "Sigmabar*+"; latexString="#bar{#Sigma}^{*+}" ;break; }
4710 
4711 
4712  case 3212: { name = "Sigma0";latexString="#Sigma^{0}" ; break; }
4713  case -3212: { name = "Sigmabar0";latexString="#bar{#Sigma}^{0}" ; break; }
4714  case 3214: { name = "Sigma*0"; latexString="#Sigma^{*0}" ;break; }
4715  case -3214: { name = "Sigma*bar0";latexString="#bar{#Sigma}^{*0}" ; break; }
4716  case 3222: { name = "Sigma+"; latexString="#Sigma^{+}" ;break; }
4717  case -3222: { name = "Sigmabar-"; latexString="#bar{#Sigma}^{-}";break; }
4718  case 3224: { name = "Sigma*+"; latexString="#Sigma^{*+}" ;break; }
4719  case -3224: { name = "Sigmabar*-"; latexString="#bar{#Sigma}^{*-}";break; }
4720 
4721  case 2212: { name = "p";latexString=name ; break; }
4722  case -2212: { name = "~p";latexString="#bar{p}" ; break; }
4723  case -2214: { name = "Delta-";latexString="#Delta^{-}" ; break; }
4724  case 2214: { name = "Delta+";latexString="#Delta^{+}" ; break; }
4725  case -2224: { name = "Deltabar--"; latexString="#bar{#Delta}^{--}" ;break; }
4726  case 2224: { name = "Delta++"; latexString= "#Delta^{++}";break; }
4727 
4728  case 3312: { name = "Xi-"; latexString= "#Xi^{-}";break; }
4729  case -3312: { name = "Xi+"; latexString= "#Xi^{+}";break; }
4730  case 3314: { name = "Xi*-"; latexString= "#Xi^{*-}";break; }
4731  case -3314: { name = "Xi*+"; latexString= "#Xi^{*+}";break; }
4732 
4733  case 3322: { name = "Xi0"; latexString= "#Xi^{0}";break; }
4734  case -3322: { name = "anti-Xi0"; latexString= "#overline{Xi^{0}}";break; }
4735  case 3324: { name = "Xi*0"; latexString= "#Xi^{*0}";break; }
4736  case -3324: { name = "anti-Xi*0"; latexString= "#overline{Xi^{*0}}";break; }
4737 
4738  case 3334: { name = "Omega-"; latexString= "#Omega^{-}";break; }
4739  case -3334: { name = "anti-Omega+"; latexString= "#Omega^{+}";break; }
4740 
4741  case 4122: { name = "Lambda_c+"; latexString= "#Lambda_{c}^{+}";break; }
4742  case -4122: { name = "Lambda_c-"; latexString= "#Lambda_{c}^{-}";break; }
4743  case 4222: { name = "Sigma_c++"; latexString= "#Sigma_{c}^{++}";break; }
4744  case -4222: { name = "Sigma_c--"; latexString= "#Sigma_{c}^{--}";break; }
4745 
4746 
4747  case 92 : {name="String"; latexString= "String";break; }
4748 
4749  case 2101 : {name="ud_0"; latexString= "ud_{0}";break; }
4750  case -2101 : {name="anti-ud_0"; latexString= "#overline{ud}_{0}";break; }
4751  case 2103 : {name="ud_1"; latexString= "ud_{1}";break; }
4752  case -2103 : {name="anti-ud_1"; latexString= "#overline{ud}_{1}";break; }
4753  case 2203 : {name="uu_1"; latexString= "uu_{1}";break; }
4754  case -2203 : {name="anti-uu_1"; latexString= "#overline{uu}_{1}";break; }
4755  case 3303 : {name="ss_1"; latexString= "#overline{ss}_{1}";break; }
4756  case 3101 : {name="sd_0"; latexString= "sd_{0}";break; }
4757  case -3101 : {name="anti-sd_0"; latexString= "#overline{sd}_{0}";break; }
4758  case 3103 : {name="sd_1"; latexString= "sd_{1}";break; }
4759  case -3103 : {name="anti-sd_1"; latexString= "#overline{sd}_{1}";break; }
4760 
4761  case 20213 : {name="a_1+"; latexString= "a_{1}^{+}";break; }
4762  case -20213 : {name="a_1-"; latexString= "a_{1}^{-}";break; }
4763 
4764  default:
4765  {
4766  name = "unknown";
4767  cout << "Unknown code : " << partId << endl;
4768  break;
4769  }
4770 
4771 
4772  }
4773  return name;
4774 
4775 }
tuple cout
Definition: gather_cfg.py:121
bool PFRootEventManager::highPtJet ( double  ptMin) const

returns true if there is at least one jet with pT>pTmin

Definition at line 2183 of file PFRootEventManager.cc.

References i, pfJets_, and PtMinSelector_cfg::ptMin.

2183  {
2184  for( unsigned i=0; i<pfJets_.size(); ++i) {
2185  if( pfJets_[i].pt() > ptMin ) return true;
2186  }
2187  return false;
2188 }
int i
Definition: DBlmapReader.cc:9
reco::PFJetCollection pfJets_
PF Jets.
bool PFRootEventManager::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

Definition at line 2190 of file PFRootEventManager.cc.

References i, reco::PFCandidate::particleId(), pfCandidates_, reco::LeafCandidate::pt(), PtMinSelector_cfg::ptMin, and X.

2191  {
2192  for( unsigned i=0; i<pfCandidates_->size(); ++i) {
2193 
2194  const PFCandidate& pfc = (*pfCandidates_)[i];
2195  if(type!= PFCandidate::X &&
2196  pfc.particleId() != type ) continue;
2197  if( pfc.pt() > ptMin ) return true;
2198  }
2199  return false;
2200 }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
#define X(str)
Definition: MuonsGrabber.cc:49
std::auto_ptr< reco::PFCandidateCollection > pfCandidates_
reconstructed pfCandidates
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
virtual ParticleType particleId() const
Definition: PFCandidate.h:347
virtual float pt() const GCC11_FINAL
transverse momentum
void PFRootEventManager::initializeEventInformation ( )

Definition at line 105 of file PFRootEventManager.cc.

References gather_cfg::cout, ev_, edm::EventID::event(), edm::EventBase::id(), edm::EventID::luminosityBlock(), mapEventToEntry_, edm::EventID::run(), fwlite::ChainEvent::size(), and fwlite::ChainEvent::to().

Referenced by PFRootEventManager().

105  {
106 
107  unsigned int nev = ev_->size();
108  for ( unsigned int entry = 0; entry < nev; ++entry ) {
109  ev_->to(entry);
110  const edm::EventBase& iEv = *ev_;
111  mapEventToEntry_[iEv.id().run()][iEv.id().luminosityBlock()][iEv.id().event()] = entry;
112  }
113 
114  cout<<"Number of events: "<< nev
115  <<" starting with event: "<<mapEventToEntry_.begin()->first<<endl;
116 }
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
Long64_t size() const
Definition: ChainEvent.cc:311
fwlite::ChainEvent * ev_
NEW: input event.
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
bool to(Long64_t iIndex)
Go to the event at index iIndex.
Definition: ChainEvent.cc:115
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:121
bool PFRootEventManager::isHadronicTau ( ) const

study the sim event to check if the tau decay is hadronic

Definition at line 2615 of file PFRootEventManager.cc.

References abs, reco::PFSimParticle::daughterIds(), i, reco::PFSimParticle::pdgCode(), and trueParticles_.

Referenced by readFromSimulation().

2615  {
2616 
2617  for ( unsigned i=0; i < trueParticles_.size(); i++) {
2618  const reco::PFSimParticle& ptc = trueParticles_[i];
2619  const std::vector<int>& ptcdaughters = ptc.daughterIds();
2620  if (std::abs(ptc.pdgCode()) == 15) {
2621  for ( unsigned int dapt=0; dapt < ptcdaughters.size(); ++dapt) {
2622 
2623  const reco::PFSimParticle& daughter
2624  = trueParticles_[ptcdaughters[dapt]];
2625 
2626 
2627  int pdgdaugther = daughter.pdgCode();
2628  int abspdgdaughter = std::abs(pdgdaugther);
2629 
2630 
2631  if (abspdgdaughter == 11 ||
2632  abspdgdaughter == 13) {
2633  return false;
2634  }//electron or muons?
2635  }//loop daughter
2636  }//tau
2637  }//loop particles
2638 
2639 
2640  return true;
2641 }
const std::vector< int > & daughterIds() const
Definition: PFSimParticle.h:44
int i
Definition: DBlmapReader.cc:9
#define abs(x)
Definition: mlp_lapack.h:159
int pdgCode() const
Definition: PFSimParticle.h:35
reco::PFSimParticleCollection trueParticles_
true particle for particle flow
Definition: PFSimParticle.h:19
void PFRootEventManager::mcTruthMatching ( std::ostream &  out,
const reco::PFCandidateCollection candidates,
std::vector< std::list< simMatch > > &  candSimMatchTrack,
std::vector< std::list< simMatch > > &  candSimMatchEcal 
) const

Definition at line 4778 of file PFRootEventManager.cc.

References gather_cfg::cout, reco::PFSimParticle::daughterIds(), reco::PFRecHit::detId(), reco::PFBlockElement::ECAL, reco::PFBlock::elements(), reco::PFCandidate::elementsInBlocks(), relval_parameters_module::energy, reco::PFRecHit::energy(), i, edm::Ref< C, T, F >::isNull(), reco::PFSimParticle::recHitContrib(), reco::PFSimParticle::recHitContribFrac(), rechitsECAL_, reco::PFSimParticle::rectrackId(), reco::PFBlockElement::TRACK, trueParticles_, VERBOSE, and verbosity_.

Referenced by print().

4782 {
4783 
4784  if(!out) return;
4785  out << endl;
4786  out << "Running Monte Carlo Truth Matching Tool" << endl;
4787  out << endl;
4788 
4789  //resize matching vectors
4790  candSimMatchTrack.resize(candidates.size());
4791  candSimMatchEcal.resize(candidates.size());
4792 
4793  for(unsigned i=0; i<candidates.size(); i++) {
4794  const reco::PFCandidate& pfCand = candidates[i];
4795 
4796  //Matching with ECAL clusters
4797  if (verbosity_ == VERBOSE ) {
4798  out <<i<<" " <<(*pfCandidates_)[i]<<endl;
4799  out << "is matching:" << endl;
4800  }
4801 
4802  PFCandidate::ElementsInBlocks eleInBlocks
4803  = pfCand.elementsInBlocks();
4804 
4805  for(unsigned iel=0; iel<eleInBlocks.size(); ++iel) {
4806  PFBlockRef blockRef = eleInBlocks[iel].first;
4807  unsigned indexInBlock = eleInBlocks[iel].second;
4808 
4809  //Retrieving elements of the block
4810  const reco::PFBlock& blockh
4811  = *blockRef;
4813  elements_h = blockh.elements();
4814 
4816  = elements_h[ indexInBlock ].type();
4817 // cout <<"(" << blockRef.key() << "|" <<indexInBlock <<"|"
4818 // << elements_h[ indexInBlock ].type() << ")," << endl;
4819 
4820  //TRACK=================================
4821  if(type == reco::PFBlockElement::TRACK){
4822  const reco::PFRecTrackRef trackref
4823  = elements_h[ indexInBlock ].trackRefPF();
4824  assert( !trackref.isNull() );
4825  const reco::PFRecTrack& track = *trackref;
4826  const reco::TrackRef trkREF = track.trackRef();
4827  unsigned rtrkID = track.trackId();
4828 
4829  //looking for the matching charged simulated particle:
4830  for ( unsigned isim=0; isim < trueParticles_.size(); isim++) {
4831  const reco::PFSimParticle& ptc = trueParticles_[isim];
4832  unsigned trackIDM = ptc.rectrackId();
4833  if(trackIDM != 99999
4834  && trackIDM == rtrkID){
4835 
4836  if (verbosity_ == VERBOSE )
4837  out << "\tSimParticle " << isim
4838  << " through Track matching pTrectrack="
4839  << trkREF->pt() << " GeV" << endl;
4840 
4841  //store info
4842  std::pair<double, unsigned> simtrackmatch
4843  = make_pair(trkREF->pt(),trackIDM);
4844  candSimMatchTrack[i].push_back(simtrackmatch);
4845  }//match
4846  }//loop simparticles
4847 
4848  }//TRACK
4849 
4850  //ECAL=================================
4851  if(type == reco::PFBlockElement::ECAL)
4852  {
4853  const reco::PFClusterRef clusterref
4854  = elements_h[ indexInBlock ].clusterRef();
4855  assert( !clusterref.isNull() );
4856  const reco::PFCluster& cluster = *clusterref;
4857 
4858  const std::vector< reco::PFRecHitFraction >&
4859  fracs = cluster.recHitFractions();
4860 
4861 // cout << "This is an ecal cluster of energy "
4862 // << cluster.energy() << endl;
4863  vector<unsigned> simpID;
4864  vector<double> simpEC(trueParticles_.size(),0.0);
4865  vector<unsigned> simpCN(trueParticles_.size(),0);
4866  for(unsigned int rhit = 0; rhit < fracs.size(); ++rhit){
4867 
4868  const reco::PFRecHitRef& rh = fracs[rhit].recHitRef();
4869  if(rh.isNull()) continue;
4870  const reco::PFRecHit& rechit_cluster = *rh;
4871 // cout << rhit << " ID=" << rechit_cluster.detId()
4872 // << " E=" << rechit_cluster.energy()
4873 // << " fraction=" << fracs[rhit].fraction() << " ";
4874 
4875  //loop on sim particules
4876 // cout << "coming from sim particles: ";
4877  for ( unsigned isim=0; isim < trueParticles_.size(); isim++) {
4878  const reco::PFSimParticle& ptc = trueParticles_[isim];
4879 
4880  vector<unsigned> rechitSimIDs
4881  = ptc.recHitContrib();
4882  vector<double> rechitSimFrac
4883  = ptc.recHitContribFrac();
4884  //cout << "Number of rechits contrib =" << rechitSimIDs.size() << endl;
4885  if( !rechitSimIDs.size() ) continue; //no rechit
4886 
4887  for ( unsigned isimrh=0; isimrh < rechitSimIDs.size(); isimrh++) {
4888  if( rechitSimIDs[isimrh] == rechit_cluster.detId() ){
4889 
4890  bool takenalready = false;
4891  for(unsigned iss = 0; iss < simpID.size(); ++iss)
4892  if(simpID[iss] == isim) takenalready = true;
4893  if(!takenalready) simpID.push_back(isim);
4894 
4895  simpEC[isim] +=
4896  ((rechit_cluster.energy()*rechitSimFrac[isimrh])/100.0)
4897  *fracs[rhit].fraction();
4898 
4899  simpCN[isim]++; //counting rechits
4900 
4901 // cout << isim << " with contribution of ="
4902 // << rechitSimFrac[isimrh] << "%, ";
4903  }//match rechit
4904  }//loop sim rechit
4905  }//loop sim particules
4906 // cout << endl;
4907  }//loop cand rechit
4908 
4909  for(unsigned is=0; is < simpID.size(); ++is)
4910  {
4911  double frac_of_cluster
4912  = (simpEC[simpID[is]]/cluster.energy())*100.0;
4913 
4914  //store info
4915  std::pair<double, unsigned> simecalmatch
4916  = make_pair(simpEC[simpID[is]],simpID[is]);
4917  candSimMatchEcal[i].push_back(simecalmatch);
4918 
4919  if (verbosity_ == VERBOSE ) {
4920  out << "\tSimParticle " << simpID[is]
4921  << " through ECAL matching Epfcluster="
4922  << cluster.energy()
4923  << " GeV with N=" << simpCN[simpID[is]]
4924  << " rechits in common "
4925  << endl;
4926  out << "\t\tsimparticle contributing to a total of "
4927  << simpEC[simpID[is]]
4928  << " GeV of this cluster ("
4929  << frac_of_cluster << "%) "
4930  << endl;
4931  }
4932  }//loop particle matched
4933  }//ECAL clusters
4934 
4935  }//loop elements
4936 
4937  if (verbosity_ == VERBOSE )
4938  cout << "==============================================================="
4939  << endl;
4940 
4941  }//loop pfCandidates_
4942 
4943  if (verbosity_ == VERBOSE ){
4944 
4945  cout << "=================================================================="
4946  << endl;
4947  cout << "SimParticles" << endl;
4948 
4949  //loop simulated particles
4950  for ( unsigned i=0; i < trueParticles_.size(); i++) {
4951  cout << "==== Particle Simulated " << i << endl;
4952  const reco::PFSimParticle& ptc = trueParticles_[i];
4953  out <<i<<" "<<trueParticles_[i]<<endl;
4954 
4955  if(!ptc.daughterIds().empty()){
4956  cout << "Look at the desintegration products" << endl;
4957  cout << endl;
4958  continue;
4959  }
4960 
4961  //TRACKING
4962  if(ptc.rectrackId() != 99999){
4963  cout << "matching pfCandidate (trough tracking): " << endl;
4964  for( unsigned icand=0; icand<candidates.size(); icand++ )
4965  {
4966  ITM it = candSimMatchTrack[icand].begin();
4967  ITM itend = candSimMatchTrack[icand].end();
4968  for(;it!=itend;++it)
4969  if( i == it->second ){
4970  out<<icand<<" "<<(*pfCandidates_)[icand]<<endl;
4971  cout << endl;
4972  }
4973  }//loop candidate
4974  }//trackmatch
4975 
4976 
4977  //CALORIMETRY
4978  vector<unsigned> rechitSimIDs
4979  = ptc.recHitContrib();
4980  vector<double> rechitSimFrac
4981  = ptc.recHitContribFrac();
4982  //cout << "Number of rechits contrib =" << rechitSimIDs.size() << endl;
4983  if( !rechitSimIDs.size() ) continue; //no rechit
4984 
4985  cout << "matching pfCandidate (through ECAL): " << endl;
4986 
4987  //look at total ECAL desposition:
4988  double totalEcalE = 0.0;
4989  for(unsigned irh=0; irh<rechitsECAL_.size();++irh)
4990  for ( unsigned isimrh=0; isimrh < rechitSimIDs.size();
4991  isimrh++ )
4992  if(rechitSimIDs[isimrh] == rechitsECAL_[irh].detId())
4993  totalEcalE += (rechitsECAL_[irh].energy()*rechitSimFrac[isimrh]/100.0);
4994  cout << "For info, this particle deposits E=" << totalEcalE
4995  << "(GeV) in the ECAL" << endl;
4996 
4997  for( unsigned icand=0; icand<candidates.size(); icand++ )
4998  {
4999  ITM it = candSimMatchEcal[icand].begin();
5000  ITM itend = candSimMatchEcal[icand].end();
5001  for(;it!=itend;++it)
5002  if( i == it->second )
5003  out<<icand<<" "<<it->first<<"GeV "<<(*pfCandidates_)[icand]<<endl;
5004  }//loop candidate
5005  cout << endl;
5006  }//loop particles
5007  }//verbose
5008 
5009 }//mctruthmatching
const std::vector< int > & daughterIds() const
Definition: PFSimParticle.h:44
type
Definition: HCALResponse.h:21
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
int i
Definition: DBlmapReader.cc:9
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
unsigned detId() const
rechit detId
Definition: PFRecHit.h:105
unsigned rectrackId() const
Definition: PFSimParticle.h:47
const edm::OwnVector< reco::PFBlockElement > & elements() const
Definition: PFBlock.h:107
std::vector< ElementInBlock > ElementsInBlocks
Definition: PFCandidate.h:360
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.h:365
reco::PFSimParticleCollection trueParticles_
bool isNull() const
Checks for null.
Definition: Ref.h:247
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
std::list< std::pair< double, unsigned > >::iterator ITM
std::vector< double > recHitContribFrac() const
Definition: PFSimParticle.h:51
true particle for particle flow
Definition: PFSimParticle.h:19
tuple out
Definition: dbtoconf.py:99
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
double energy() const
rechit energy
Definition: PFRecHit.h:111
reco::PFRecHitCollection rechitsECAL_
tuple cout
Definition: gather_cfg.py:121
int verbosity_
verbosity
std::vector< unsigned > recHitContrib() const
Definition: PFSimParticle.h:49
Block of elements.
Definition: PFBlock.h:30
void PFRootEventManager::particleFlow ( )

performs particle flow

Definition at line 3079 of file PFRootEventManager.cc.

References PFAlgo::checkCleaning(), clustersECAL_, clustersHCAL_, clustersHFEM_, clustersHFHAD_, clustersHO_, clustersPS_, convBremGsfrecTracks_, conversion_, gather_cfg::cout, debug_, displacedRecTracks_, ebsc_, eesc_, egammaElectrons_, fillClusterMask(), fillOutEventWithPFCandidates(), fillPhotonMask(), fillTrackMask(), PFBlockAlgo::findBlocks(), gsfrecTracks_, muons_, pfAlgo_, pfBlockAlgo_, pfBlocks_, pfCandidateElectronExtras_, pfCandidates_, pfNuclearTrackerVertex_, photons_, primaryVertices_, primaryVerticesHandle_, edm::Handle< T >::product(), rechitsCLEANED_, PFAlgo::reconstructParticles(), recTracks_, PFAlgo::setEGElectronCollection(), PFAlgo::setElectronExtraRef(), PFBlockAlgo::setInput(), PFAlgo::setPFVertexParameters(), PFBlockAlgo::transferBlocks(), PFAlgo::transferCandidates(), PFAlgo::transferElectronExtra(), useAtHLT_, useEGElectrons_, useHO_, usePFElectrons_, v0_, VERBOSE, and verbosity_.

Referenced by processEntry().

3079  {
3080 
3081  if (verbosity_ == VERBOSE ) {
3082  cout <<"start particle flow"<<endl;
3083  }
3084 
3085 
3086  if( debug_) {
3087  cout<<"PFRootEventManager::particleFlow start"<<endl;
3088  // cout<<"number of elements in memory: "
3089  // <<reco::PFBlockElement::instanceCounter()<<endl;
3090  }
3091 
3092 
3094  edm::ProductID(1) );
3095 
3097  edm::ProductID(77) );
3098 
3100  edm::ProductID(2) );
3101 
3103  edm::ProductID(3) );
3104 
3106  edm::ProductID(21) ); //GMA put this four
3107 
3109  edm::ProductID(31) );
3110 
3112  edm::ProductID(32) );
3113 
3115  edm::ProductID(4) );
3116 
3118  edm::ProductID(5) );
3119 
3121  edm::ProductID(6) );
3122 
3124  edm::ProductID(7) );
3125 
3126 
3127  //recoPFRecTracks_pfNuclearTrackerVertex__TEST.
3128 
3130  edm::ProductID(8) );
3131 
3133  edm::ProductID(9) );
3134 
3135 
3137  edm::ProductID(10) );
3138 
3140  edm::ProductID(11) );
3141 
3143 
3146 
3147 
3148  vector<bool> trackMask;
3149  fillTrackMask( trackMask, recTracks_ );
3150  vector<bool> gsftrackMask;
3151  fillTrackMask( gsftrackMask, gsfrecTracks_ );
3152  vector<bool> ecalMask;
3153  fillClusterMask( ecalMask, *clustersECAL_ );
3154  vector<bool> hcalMask;
3155  fillClusterMask( hcalMask, *clustersHCAL_ );
3156 
3157  vector<bool> scmask;
3158 
3159  vector<bool> hoMask;
3160  if (useHO_) {fillClusterMask( hoMask, *clustersHO_ );}
3161 
3162  vector<bool> hfemMask;
3163  fillClusterMask( hfemMask, *clustersHFEM_ );
3164  vector<bool> hfhadMask;
3165  fillClusterMask( hfhadMask, *clustersHFHAD_ );
3166  vector<bool> psMask;
3167  fillClusterMask( psMask, *clustersPS_ );
3168  vector<bool> photonMask;
3169  fillPhotonMask( photonMask, photons_ );
3170 
3171  if ( !useAtHLT_ )
3172  pfBlockAlgo_.setInput( trackh, gsftrackh, convBremGsftrackh,
3173  muonh, nuclearh, displacedtrackh, convh, v0,
3174  ecalh, hcalh, hoh, hfemh, hfhadh, psh,
3175  photonh, ebsch, eesch, trackMask,gsftrackMask,
3176  ecalMask, hcalMask, hoMask, hfemMask, hfhadMask, psMask,photonMask,scmask );
3177  else
3178  pfBlockAlgo_.setInput( trackh, muonh, ecalh, hcalh, hfemh, hfhadh, psh, hoh,
3179  trackMask, ecalMask, hcalMask, hoMask, psMask);
3180 
3182 
3183  if( debug_) cout<<pfBlockAlgo_<<endl;
3184 
3186 
3188  if(useEGElectrons_)
3190 
3192  // pfAlgoOther_.reconstructParticles( blockh );
3193 
3194  // pfAlgo_.postMuonCleaning(muonsHandle_, *vertexh);
3195 
3196 
3197  if(usePFElectrons_) {
3200  pfAlgo_.setElectronExtraRef(electronExtraProd);
3201  }
3202 
3204 
3205  if( debug_) cout<< pfAlgo_<<endl;
3207  // pfCandidatesOther_ = pfAlgoOther_.transferCandidates();
3208 
3210 
3211  if( debug_) cout<<"PFRootEventManager::particleFlow stop"<<endl;
3212 }
std::auto_ptr< reco::PFBlockCollection > pfBlocks_
reconstructed pfblocks
bool useAtHLT_
Use HLT tracking.
std::auto_ptr< reco::PFCandidateCollection > transferCandidates()
Definition: PFAlgo.h:203
void fillClusterMask(std::vector< bool > &mask, const reco::PFClusterCollection &clusters) const
cluster mask set to true for rechits inside TCutG
void fillTrackMask(std::vector< bool > &mask, const reco::PFRecTrackCollection &tracks) const
track mask set to true for rechits inside TCutG
void fillOutEventWithPFCandidates(const reco::PFCandidateCollection &pfCandidates)
fills OutEvent with candidates
bool debug_
debug printouts for this PFRootEventManager on/off
void reconstructParticles(const reco::PFBlockHandle &blockHandle)
Definition: PFAlgo.cc:343
std::auto_ptr< reco::PFClusterCollection > clustersECAL_
std::auto_ptr< reco::PFCandidateElectronExtraCollection > transferElectronExtra()
Definition: PFAlgo.h:181
reco::MuonCollection muons_
reco::PFRecTrackCollection displacedRecTracks_
void checkCleaning(const reco::PFRecHitCollection &cleanedHF)
Check HF Cleaning.
Definition: PFAlgo.cc:3365
std::auto_ptr< reco::PFClusterCollection > clustersHCAL_
reco::PhotonCollection photons_
bool usePFElectrons_
Use PFElectrons.
reco::PFRecTrackCollection recTracks_
void setPFVertexParameters(bool useVertex, const reco::VertexCollection *primaryVertices)
Definition: PFAlgo.cc:300
void setEGElectronCollection(const reco::GsfElectronCollection &egelectrons)
Definition: PFAlgo.cc:3253
void fillPhotonMask(std::vector< bool > &mask, const reco::PhotonCollection &photons) const
photon mask set to true for photons inside TCutG
reco::VertexCollection primaryVertices_
std::auto_ptr< reco::PFClusterCollection > clustersPS_
std::auto_ptr< reco::PFCandidateElectronExtraCollection > pfCandidateElectronExtras_
PFCandidateElectronExtra.
reco::GsfPFRecTrackCollection gsfrecTracks_
std::auto_ptr< reco::PFClusterCollection > clustersHO_
PFAlgo pfAlgo_
particle flow algorithm
reco::SuperClusterCollection eesc_
std::auto_ptr< reco::PFCandidateCollection > pfCandidates_
reconstructed pfCandidates
reco::GsfPFRecTrackCollection convBremGsfrecTracks_
std::auto_ptr< reco::PFClusterCollection > clustersHFEM_
reco::PFRecHitCollection rechitsCLEANED_
std::auto_ptr< reco::PFClusterCollection > clustersHFHAD_
PFBlockAlgo pfBlockAlgo_
algorithm for building the particle flow blocks
std::auto_ptr< reco::PFBlockCollection > transferBlocks()
Definition: PFBlockAlgo.h:195
void findBlocks()
build blocks
Definition: PFBlockAlgo.cc:84
reco::PFDisplacedTrackerVertexCollection pfNuclearTrackerVertex_
T const * product() const
Definition: Handle.h:74
edm::Handle< reco::VertexCollection > primaryVerticesHandle_
reconstructed primary vertices
bool useHO_
Use of HO in links with tracks/HCAL and in particle flow reconstruction.
tuple cout
Definition: gather_cfg.py:121
int verbosity_
verbosity
reco::SuperClusterCollection ebsc_
superclusters
reco::PFConversionCollection conversion_
bool useEGElectrons_
Use EGElectrons.
reco::GsfElectronCollection egammaElectrons_
void setInput(const T< reco::PFRecTrackCollection > &trackh, const T< reco::GsfPFRecTrackCollection > &gsftrackh, const T< reco::GsfPFRecTrackCollection > &convbremgsftrackh, const T< reco::MuonCollection > &muonh, const T< reco::PFDisplacedTrackerVertexCollection > &nuclearh, const T< reco::PFRecTrackCollection > &nucleartrackh, const T< reco::PFConversionCollection > &conv, const T< reco::PFV0Collection > &v0, const T< reco::PFClusterCollection > &ecalh, const T< reco::PFClusterCollection > &hcalh, const T< reco::PFClusterCollection > &hoh, const T< reco::PFClusterCollection > &hfemh, const T< reco::PFClusterCollection > &hfhadh, const T< reco::PFClusterCollection > &psh, const T< reco::PhotonCollection > &egphh, const T< reco::SuperClusterCollection > &sceb, const T< reco::SuperClusterCollection > &scee, const Mask &trackMask=dummyMask_, const Mask &gsftrackMask=dummyMask_, const Mask &ecalMask=dummyMask_, const Mask &hcalMask=dummyMask_, const Mask &hoMask=dummyMask_, const Mask &hfemMask=dummyMask_, const Mask &hfhadMask=dummyMask_, const Mask &psMask=dummyMask_, const Mask &phMask=dummyMask_, const Mask &scMask=dummyMask_)
set input collections of tracks and clusters
Definition: PFBlockAlgo.h:384
void setElectronExtraRef(const edm::OrphanHandle< reco::PFCandidateElectronExtraCollection > &extrah)
Definition: PFAlgo.cc:3470
reco::PFV0Collection v0_
void PFRootEventManager::pfCandCompare ( int  entry)

compare particle flow

Definition at line 3214 of file PFRootEventManager.cc.

References gather_cfg::cout, HLTFastRecoForTau_cff::deltaEta, SiPixelRawToDigiRegional_cfi::deltaPhi, i, pfCandCMSSW_, and pfCandidates_.

Referenced by processEntry().

3214  {
3215 
3216  /*
3217  cout << "ievt " << entry <<" : PFCandidate : "
3218  << " original size : " << pfCandCMSSW_.size()
3219  << " current size : " << pfCandidates_->size() << endl;
3220  */
3221 
3222  bool differentSize = pfCandCMSSW_.size() != pfCandidates_->size();
3223  if ( differentSize ) {
3224  cout << "+++WARNING+++ PFCandidate size changed for entry "
3225  << entry << " !" << endl
3226  << " - original size : " << pfCandCMSSW_.size() << endl
3227  << " - current size : " << pfCandidates_->size() << endl;
3228  } else {
3229  for(unsigned i=0; i<pfCandidates_->size(); i++) {
3230  double deltaE = (*pfCandidates_)[i].energy()-pfCandCMSSW_[i].energy();
3231  double deltaEta = (*pfCandidates_)[i].eta()-pfCandCMSSW_[i].eta();
3232  double deltaPhi = (*pfCandidates_)[i].phi()-pfCandCMSSW_[i].phi();
3233  if ( fabs(deltaE) > 1E-4 ||
3234  fabs(deltaEta) > 1E-9 ||
3235  fabs(deltaPhi) > 1E-9 ) {
3236  cout << "+++WARNING+++ PFCandidate " << i
3237  << " changed for entry " << entry << " ! " << endl
3238  << " - Original : " << pfCandCMSSW_[i] << endl
3239  << " - Current : " << (*pfCandidates_)[i] << endl
3240  << " DeltaE = : " << deltaE << endl
3241  << " DeltaEta = : " << deltaEta << endl
3242  << " DeltaPhi = : " << deltaPhi << endl << endl;
3243  }
3244  }
3245  }
3246 }
int i
Definition: DBlmapReader.cc:9
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
reco::PFCandidateCollection pfCandCMSSW_
std::auto_ptr< reco::PFCandidateCollection > pfCandidates_
reconstructed pfCandidates
tuple cout
Definition: gather_cfg.py:121
void PFRootEventManager::PreprocessRecHits ( reco::PFRecHitCollection rechits,
bool  findNeighbours 
)

preprocess a rechit vector from a given rechit branch

Definition at line 2805 of file PFRootEventManager.cc.

References i, and setRecHitNeigbours().

Referenced by readFromSimulation().

2806  {
2807 
2808 
2809  map<unsigned, unsigned> detId2index;
2810 
2811  for(unsigned i=0; i<rechits.size(); i++) {
2812  rechits[i].calculatePositionREP();
2813 
2814  if(findNeighbours)
2815  detId2index.insert( make_pair(rechits[i].detId(), i) );
2816  }
2817 
2818  if(findNeighbours) {
2819  for(unsigned i=0; i<rechits.size(); i++) {
2820  setRecHitNeigbours( rechits[i], detId2index );
2821  }
2822  }
2823 }
int i
Definition: DBlmapReader.cc:9
void setRecHitNeigbours(reco::PFRecHit &rh, const std::map< unsigned, unsigned > &detId2index)
void PFRootEventManager::PreprocessRecTracks ( reco::PFRecTrackCollection rectracks)

preprocess a rectrack vector from a given rectrack branch

Definition at line 2784 of file PFRootEventManager.cc.

2784  {
2785  /*
2786  for( unsigned i=0; i<recTracks.size(); ++i ) {
2787  recTracks[i].calculatePositionREP();
2788  }
2789  */
2790 }
void PFRootEventManager::PreprocessRecTracks ( reco::GsfPFRecTrackCollection rectracks)

Definition at line 2793 of file PFRootEventManager.cc.

2793  {
2794  /*
2795  for( unsigned i=0; i<recTracks.size(); ++i ) {
2796  recTracks[i].calculatePositionREP();
2797  recTracks[i].calculateBremPositionREP();
2798  }
2799  */
2800 }
void PFRootEventManager::print ( std::ostream &  out = std::cout,
int  maxNLines = -1 
) const

print information

Definition at line 3923 of file PFRootEventManager.cc.

References caloJets_, clusterAlgoECAL_, clusterAlgoHCAL_, clusterAlgoHFEM_, clusterAlgoHFHAD_, clusterAlgoHO_, clusterAlgoPS_, clustersECAL_, clustersHCAL_, clustersHFEM_, clustersHFHAD_, clustersHO_, clustersPS_, gather_cfg::cout, reco::PFSimParticle::daughterIds(), relval_parameters_module::energy, reco::PFTrack::extrapolatedPoint(), genJets_, i, mcTruthMatching(), reco::PFTrajectoryPoint::momentum(), pfBlocks_, pfCandidates_, pfJets_, printClusters(), printClusters_, printGenParticles(), printGenParticles_, printMCTruthMatching_, printPFBlocks_, printPFCandidates_, printPFCandidatesPtMin_, printPFJets_, printPFJetsPtMin_, printRecHits(), printRecHits_, printSimParticles_, printSimParticlesPtMin_, reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::PFSimParticle::recHitContrib(), reco::PFSimParticle::recHitContribFrac(), rechitsECAL_, rechitsHCAL_, rechitsHFEM_, rechitsHFHAD_, rechitsHO_, rechitsPS_, reco::PFSimParticle::rectrackId(), mathSSE::sqrt(), trackInsideGCut(), trueParticles_, and useHO_.

Referenced by DialogFrame::doPrint(), DisplayManager::printDisplay(), and processEntry().

3923  {
3924 
3925  if(!out) return;
3926 
3927  //If McTruthMatching print a detailed list
3928  //of matching between simparticles and PFCandidates
3929  //MCTruth Matching vectors.
3930  std::vector< std::list <simMatch> > candSimMatchTrack;
3931  std::vector< std::list <simMatch> > candSimMatchEcal;
3932  if( printMCTruthMatching_){
3934  *pfCandidates_,
3935  candSimMatchTrack,
3936  candSimMatchEcal);
3937  }
3938 
3939 
3940  if( printRecHits_ ) {
3941  out<<"ECAL RecHits ==============================================="<<endl;
3943  out<<"HCAL RecHits ==============================================="<<endl;
3945  if (useHO_) {
3946  out<<"HO RecHits ================================================="<<endl;
3948  }
3949  out<<"HFEM RecHits ==============================================="<<endl;
3951  out<<"HFHAD RecHits =============================================="<<endl;
3953  out<<"PS RecHits ================================================="<<endl;
3955  }
3956 
3957  if( printClusters_ ) {
3958  out<<"ECAL Clusters ============================================="<<endl;
3959  printClusters( *clustersECAL_, out); out<<endl;
3960  out<<"HCAL Clusters ============================================="<<endl;
3961  printClusters( *clustersHCAL_, out); out<<endl;
3962  if (useHO_) {
3963  out<<"HO Clusters ==============================================="<<endl;
3964  printClusters( *clustersHO_, out); out<<endl;
3965  }
3966  out<<"HFEM Clusters ============================================="<<endl;
3967  printClusters( *clustersHFEM_, out); out<<endl;
3968  out<<"HFHAD Clusters ============================================"<<endl;
3969  printClusters( *clustersHFHAD_, out); out<<endl;
3970  out<<"PS Clusters ============================================="<<endl;
3971  printClusters( *clustersPS_, out); out<<endl;
3972  }
3973  bool printTracks = true;
3974  if( printTracks) {
3975 
3976  }
3977  if( printPFBlocks_ ) {
3978  out<<"Particle Flow Blocks ======================================"<<endl;
3979  for(unsigned i=0; i<pfBlocks_->size(); i++) {
3980  out<<i<<" "<<(*pfBlocks_)[i]<<endl;
3981  }
3982  out<<endl;
3983  }
3984  if(printPFCandidates_) {
3985  out<<"Particle Flow Candidates =================================="<<endl;
3986  double mex = 0.;
3987  double mey = 0.;
3988  for(unsigned i=0; i<pfCandidates_->size(); i++) {
3989  const PFCandidate& pfc = (*pfCandidates_)[i];
3990  mex -= pfc.px();
3991  mey -= pfc.py();
3992  if(pfc.pt()>printPFCandidatesPtMin_)
3993  out<<i<<" " <<(*pfCandidates_)[i]<<endl;
3994  }
3995  out<<endl;
3996  out<< "MEX, MEY, MET ============================================" <<endl
3997  << mex << " " << mey << " " << sqrt(mex*mex+mey*mey);
3998  out<<endl;
3999  out<<endl;
4000 
4001  //print a detailed list of PFSimParticles matching
4002  //the PFCandiates
4004  cout<<"MCTruthMatching Results"<<endl;
4005  for(unsigned icand=0; icand<pfCandidates_->size();
4006  icand++) {
4007  out <<icand<<" " <<(*pfCandidates_)[icand]<<endl;
4008  out << "is matching:" << endl;
4009 
4010  //tracking
4011  ITM it_t = candSimMatchTrack[icand].begin();
4012  ITM itend_t = candSimMatchTrack[icand].end();
4013  for(;it_t!=itend_t;++it_t){
4014  unsigned simid = it_t->second;
4015  out << "\tSimParticle " << trueParticles_[simid]
4016  <<endl;
4017  out << "\t\tthrough Track matching pTrectrack="
4018  << it_t->first << " GeV" << endl;
4019  }//loop simparticles
4020 
4021  ITM it_e = candSimMatchEcal[icand].begin();
4022  ITM itend_e = candSimMatchEcal[icand].end();
4023  for(;it_e!=itend_e;++it_e){
4024  unsigned simid = it_e->second;
4025  out << "\tSimParticle " << trueParticles_[simid]
4026  << endl;
4027  out << "\t\tsimparticle contributing to a total of "
4028  << it_e->first
4029  << " GeV of its ECAL cluster"
4030  << endl;
4031  }//loop simparticles
4032  cout<<"________________"<<endl;
4033  }//loop candidates
4034  }
4035  }
4036  if(printPFJets_) {
4037  out<<"Jets ====================================================="<<endl;
4038  out<<"Particle Flow: "<<endl;
4039  for(unsigned i=0; i<pfJets_.size(); i++) {
4040  if (pfJets_[i].pt() > printPFJetsPtMin_ )
4041  out<<i<<pfJets_[i].print()<<endl;
4042  }
4043  out<<endl;
4044  out<<"Generated: "<<endl;
4045  for(unsigned i=0; i<genJets_.size(); i++) {
4046  if (genJets_[i].pt() > printPFJetsPtMin_ )
4047  out<<i<<genJets_[i].print()<<endl;
4048  // <<" invisible energy = "<<genJets_[i].invisibleEnergy()<<endl;
4049  }
4050  out<<endl;
4051  out<<"Calo: "<<endl;
4052  for(unsigned i=0; i<caloJets_.size(); i++) {
4053  out<<"pt = "<<caloJets_[i].pt()<<endl;
4054  }
4055  out<<endl;
4056  }
4057  if( printSimParticles_ ) {
4058  out<<"Sim Particles ==========================================="<<endl;
4059 
4060  for(unsigned i=0; i<trueParticles_.size(); i++) {
4061  if( trackInsideGCut( trueParticles_[i]) ){
4062 
4063  const reco::PFSimParticle& ptc = trueParticles_[i];
4064 
4065  // get trajectory at start point
4066  const reco::PFTrajectoryPoint& tp0 = ptc.extrapolatedPoint( 0 );
4067 
4068  if(tp0.momentum().pt()>printSimParticlesPtMin_)
4069  out<<"\t"<<trueParticles_[i]<<endl;
4070  }
4071  }
4072 
4073  //print a detailed list of PFSimParticles matching
4074  //the PFCandiates
4075  if(printMCTruthMatching_) {
4076  cout<<"MCTruthMatching Results"<<endl;
4077  for ( unsigned i=0; i < trueParticles_.size(); i++) {
4078  cout << "==== Particle Simulated " << i << endl;
4079  const reco::PFSimParticle& ptc = trueParticles_[i];
4080  out <<i<<" "<<trueParticles_[i]<<endl;
4081 
4082  if(!ptc.daughterIds().empty()){
4083  cout << "Look at the desintegration products" << endl;
4084  cout << endl;
4085  continue;
4086  }
4087 
4088  //TRACKING
4089  if(ptc.rectrackId() != 99999){
4090  cout << "matching pfCandidate (trough tracking): " << endl;
4091  for( unsigned icand=0; icand<pfCandidates_->size()
4092  ; icand++ )
4093  {
4094  ITM it = candSimMatchTrack[icand].begin();
4095  ITM itend = candSimMatchTrack[icand].end();
4096  for(;it!=itend;++it)
4097  if( i == it->second ){
4098  out<<icand<<" "<<(*pfCandidates_)[icand]<<endl;
4099  cout << endl;
4100  }
4101  }//loop candidate
4102  }//trackmatch
4103 
4104  //CALORIMETRY
4105  vector<unsigned> rechitSimIDs
4106  = ptc.recHitContrib();
4107  vector<double> rechitSimFrac
4108  = ptc.recHitContribFrac();
4109  //cout << "Number of rechits contrib =" << rechitSimIDs.size() << endl;
4110  if( !rechitSimIDs.size() ) continue; //no rechit
4111 
4112  cout << "matching pfCandidate (through ECAL): " << endl;
4113 
4114  //look at total ECAL desposition:
4115  double totalEcalE = 0.0;
4116  for(unsigned irh=0; irh<rechitsECAL_.size();++irh)
4117  for ( unsigned isimrh=0; isimrh < rechitSimIDs.size();
4118  isimrh++ )
4119  if(rechitSimIDs[isimrh] == rechitsECAL_[irh].detId())
4120  totalEcalE += (rechitsECAL_[irh].energy()*rechitSimFrac[isimrh]/100.0);
4121  cout << "For info, this particle deposits E=" << totalEcalE
4122  << "(GeV) in the ECAL" << endl;
4123 
4124  for( unsigned icand=0; icand<pfCandidates_->size()
4125  ; icand++ )
4126  {
4127  ITM it = candSimMatchEcal[icand].begin();
4128  ITM itend = candSimMatchEcal[icand].end();
4129  for(;it!=itend;++it)
4130  if( i == it->second )
4131  out<<icand<<" "<<it->first<<"GeV "<<(*pfCandidates_)[icand]<<endl;
4132  }//loop candidate
4133  cout << endl;
4134  }//loop particles
4135  }//mctruthmatching
4136 
4137  }
4138 
4139 
4140  if ( printGenParticles_ ) {
4141  printGenParticles(out,maxNLines);
4142  }
4143 }
std::auto_ptr< reco::PFBlockCollection > pfBlocks_
reconstructed pfblocks
const std::vector< int > & daughterIds() const
Definition: PFSimParticle.h:44
int i
Definition: DBlmapReader.cc:9
PFClusterAlgo clusterAlgoHFEM_
clustering algorithm for HF, electro-magnetic layer
bool printPFJets_
print PFJets yes/no
PFClusterAlgo clusterAlgoHO_
clustering algorithm for HO
bool printPFBlocks_
print PFBlocks yes/no
std::auto_ptr< reco::PFClusterCollection > clustersECAL_
reco::GenJetCollection genJets_
gen Jets
reco::PFRecHitCollection rechitsHFHAD_
unsigned rectrackId() const
Definition: PFSimParticle.h:47
std::auto_ptr< reco::PFClusterCollection > clustersHCAL_
std::vector< ProtoJet > caloJets_
calo Jets
PFClusterAlgo clusterAlgoECAL_
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
reco::PFRecHitCollection rechitsPS_
reco::PFRecHitCollection rechitsHCAL_
reco::PFSimParticleCollection trueParticles_
void print(std::ostream &out=std::cout, int maxNLines=-1) const
print information
bool printClusters_
print clusters yes/no
std::auto_ptr< reco::PFClusterCollection > clustersPS_
void printRecHits(const reco::PFRecHitCollection &rechits, const PFClusterAlgo &clusterAlgo, std::ostream &out=std::cout) const
print rechits
T sqrt(T t)
Definition: SSEVec.h:48
void mcTruthMatching(std::ostream &out, const reco::PFCandidateCollection &candidates, std::vector< std::list< simMatch > > &candSimMatchTrack, std::vector< std::list< simMatch > > &candSimMatchEcal) const
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
PFClusterAlgo clusterAlgoHCAL_
clustering algorithm for HCAL
bool printPFCandidates_
print PFCandidates yes/no
void printClusters(const reco::PFClusterCollection &clusters, std::ostream &out=std::cout) const
print clusters
std::list< std::pair< double, unsigned > >::iterator ITM
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:76
std::auto_ptr< reco::PFClusterCollection > clustersHO_
std::vector< double > recHitContribFrac() const
Definition: PFSimParticle.h:51
reco::PFRecHitCollection rechitsHFEM_
true particle for particle flow
Definition: PFSimParticle.h:19
tuple out
Definition: dbtoconf.py:99
std::auto_ptr< reco::PFCandidateCollection > pfCandidates_
reconstructed pfCandidates
reco::PFRecHitCollection rechitsHO_
void printGenParticles(std::ostream &out=std::cout, int maxNLines=-1) const
print the HepMC truth
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
reco::PFJetCollection pfJets_
PF Jets.
std::auto_ptr< reco::PFClusterCollection > clustersHFEM_
std::auto_ptr< reco::PFClusterCollection > clustersHFHAD_
PFClusterAlgo clusterAlgoPS_
clustering algorithm for PS
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
bool useHO_
Use of HO in links with tracks/HCAL and in particle flow reconstruction.
bool printSimParticles_
print true particles yes/no
reco::PFRecHitCollection rechitsECAL_
tuple cout
Definition: gather_cfg.py:121
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
PFClusterAlgo clusterAlgoHFHAD_
clustering algorithm for HF, hadronic layer
virtual float pt() const GCC11_FINAL
transverse momentum
bool trackInsideGCut(const reco::PFTrack &track) const
is PFTrack inside cut G ? yes if at least one trajectory point is inside.
bool printGenParticles_
print MC truth yes/no
std::vector< unsigned > recHitContrib() const
Definition: PFSimParticle.h:49
bool printRecHits_
print rechits yes/no
void PFRootEventManager::printCluster ( const reco::PFCluster cluster,
std::ostream &  out = std::cout 
) const

Definition at line 4401 of file PFRootEventManager.cc.

References relval_parameters_module::energy, reco::PFCluster::energy(), eta(), phi, reco::CaloCluster::position(), and printClustersEMin_.

Referenced by printClusters().

4402  {
4403 
4404  if(!out) return;
4405 
4406  double eta = cluster.position().Eta();
4407  double phi = cluster.position().Phi();
4408  double energy = cluster.energy();
4409 
4410  if(energy<printClustersEMin_) return;
4411 
4412  TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
4413  if( !cutg || cutg->IsInside( eta, phi ) )
4414  out<<cluster<<endl;
4415 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:123
T eta() const
double energy() const
cluster energy
Definition: PFCluster.h:73
tuple out
Definition: dbtoconf.py:99
Definition: DDAxes.h:10
void PFRootEventManager::printClusters ( const reco::PFClusterCollection clusters,
std::ostream &  out = std::cout 
) const

print clusters

Definition at line 4393 of file PFRootEventManager.cc.

References i, and printCluster().

Referenced by print().

4394  {
4395  for(unsigned i=0; i<clusters.size(); i++) {
4396  printCluster(clusters[i], out);
4397  }
4398  return;
4399 }
int i
Definition: DBlmapReader.cc:9
void printCluster(const reco::PFCluster &cluster, std::ostream &out=std::cout) const
tuple out
Definition: dbtoconf.py:99
void PFRootEventManager::printGenParticles ( std::ostream &  out = std::cout,
int  maxNLines = -1 
) const

print the HepMC truth

Definition at line 4147 of file PFRootEventManager.cc.

References gather_cfg::cout, eta(), configurableAnalysis::GenParticle, edm::HepMCProduct::GetEvent(), getGenParticleName(), gen::k, MCTruth_, mergeVDriftHistosByStation::name, submitDQMOfflineCAF::nLines, AlCaHLTBitMon_ParallelJobs::p, printGenParticlesPtMin_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DialogFrame::doPrintGenParticles(), and print().

4148  {
4149 
4150 
4151  const HepMC::GenEvent* myGenEvent = MCTruth_.GetEvent();
4152  if(!myGenEvent) return;
4153 
4154  out<<"GenParticles ==========================================="<<endl;
4155 
4156  std::cout << "Id Gen Name eta phi pT E Vtx1 "
4157  << " x y z "
4158  << "Moth Vtx2 eta phi R Z Da1 Da2 Ecal?"
4159  << std::endl;
4160 
4161  int nLines = 0;
4162  for ( HepMC::GenEvent::particle_const_iterator
4163  piter = myGenEvent->particles_begin();
4164  piter != myGenEvent->particles_end();
4165  ++piter ) {
4166 
4167  if( nLines == maxNLines) break;
4168  nLines++;
4169 
4170  HepMC::GenParticle* p = *piter;
4171  /* */
4172  int partId = p->pdg_id();
4173 
4174  // We have here a subset of particles only.
4175  // To be filled according to the needs.
4176  /*switch(partId) {
4177  case 1: { name = "d"; break; }
4178  case 2: { name = "u"; break; }
4179  case 3: { name = "s"; break; }
4180  case 4: { name = "c"; break; }
4181  case 5: { name = "b"; break; }
4182  case 6: { name = "t"; break; }
4183  case -1: { name = "~d"; break; }
4184  case -2: { name = "~u"; break; }
4185  case -3: { name = "~s"; break; }
4186  case -4: { name = "~c"; break; }
4187  case -5: { name = "~b"; break; }
4188  case -6: { name = "~t"; break; }
4189  case 11: { name = "e-"; break; }
4190  case -11: { name = "e+"; break; }
4191  case 12: { name = "nu_e"; break; }
4192  case -12: { name = "~nu_e"; break; }
4193  case 13: { name = "mu-"; break; }
4194  case -13: { name = "mu+"; break; }
4195  case 14: { name = "nu_mu"; break; }
4196  case -14: { name = "~nu_mu"; break; }
4197  case 15: { name = "tau-"; break; }
4198  case -15: { name = "tau+"; break; }
4199  case 16: { name = "nu_tau"; break; }
4200  case -16: { name = "~nu_tau"; break; }
4201  case 21: { name = "gluon"; break; }
4202  case 22: { name = "gamma"; break; }
4203  case 23: { name = "Z0"; break; }
4204  case 24: { name = "W+"; break; }
4205  case 25: { name = "H0"; break; }
4206  case -24: { name = "W-"; break; }
4207  case 111: { name = "pi0"; break; }
4208  case 113: { name = "rho0"; break; }
4209  case 223: { name = "omega"; break; }
4210  case 333: { name = "phi"; break; }
4211  case 443: { name = "J/psi"; break; }
4212  case 553: { name = "Upsilon"; break; }
4213  case 130: { name = "K0L"; break; }
4214  case 211: { name = "pi+"; break; }
4215  case -211: { name = "pi-"; break; }
4216  case 213: { name = "rho+"; break; }
4217  case -213: { name = "rho-"; break; }
4218  case 221: { name = "eta"; break; }
4219  case 331: { name = "eta'"; break; }
4220  case 441: { name = "etac"; break; }
4221  case 551: { name = "etab"; break; }
4222  case 310: { name = "K0S"; break; }
4223  case 311: { name = "K0"; break; }
4224  case -311: { name = "Kbar0"; break; }
4225  case 321: { name = "K+"; break; }
4226  case -321: { name = "K-"; break; }
4227  case 411: { name = "D+"; break; }
4228  case -411: { name = "D-"; break; }
4229  case 421: { name = "D0"; break; }
4230  case 431: { name = "Ds_+"; break; }
4231  case -431: { name = "Ds_-"; break; }
4232  case 511: { name = "B0"; break; }
4233  case 521: { name = "B+"; break; }
4234  case -521: { name = "B-"; break; }
4235  case 531: { name = "Bs_0"; break; }
4236  case 541: { name = "Bc_+"; break; }
4237  case -541: { name = "Bc_+"; break; }
4238  case 313: { name = "K*0"; break; }
4239  case -313: { name = "K*bar0"; break; }
4240  case 323: { name = "K*+"; break; }
4241  case -323: { name = "K*-"; break; }
4242  case 413: { name = "D*+"; break; }
4243  case -413: { name = "D*-"; break; }
4244  case 423: { name = "D*0"; break; }
4245  case 513: { name = "B*0"; break; }
4246  case 523: { name = "B*+"; break; }
4247  case -523: { name = "B*-"; break; }
4248  case 533: { name = "B*_s0"; break; }
4249  case 543: { name = "B*_c+"; break; }
4250  case -543: { name = "B*_c-"; break; }
4251  case 1114: { name = "Delta-"; break; }
4252  case -1114: { name = "Deltabar+"; break; }
4253  case -2112: { name = "nbar0"; break; }
4254  case 2112: { name = "n"; break; }
4255  case 2114: { name = "Delta0"; break; }
4256  case -2114: { name = "Deltabar0"; break; }
4257  case 3122: { name = "Lambda0"; break; }
4258  case -3122: { name = "Lambdabar0"; break; }
4259  case 3112: { name = "Sigma-"; break; }
4260  case -3112: { name = "Sigmabar+"; break; }
4261  case 3212: { name = "Sigma0"; break; }
4262  case -3212: { name = "Sigmabar0"; break; }
4263  case 3214: { name = "Sigma*0"; break; }
4264  case -3214: { name = "Sigma*bar0"; break; }
4265  case 3222: { name = "Sigma+"; break; }
4266  case -3222: { name = "Sigmabar-"; break; }
4267  case 2212: { name = "p"; break; }
4268  case -2212: { name = "~p"; break; }
4269  case -2214: { name = "Delta-"; break; }
4270  case 2214: { name = "Delta+"; break; }
4271  case -2224: { name = "Deltabar--"; break; }
4272  case 2224: { name = "Delta++"; break; }
4273  default: {
4274  name = "unknown";
4275  cout << "Unknown code : " << partId << endl;
4276  }
4277  }
4278  */
4279  std::string latexString;
4280  std::string name = getGenParticleName(partId,latexString);
4281 
4282  math::XYZTLorentzVector momentum1(p->momentum().px(),
4283  p->momentum().py(),
4284  p->momentum().pz(),
4285  p->momentum().e() );
4286 
4287  if(momentum1.pt()<printGenParticlesPtMin_) continue;
4288 
4289  int vertexId1 = 0;
4290 
4291  if ( !p->production_vertex() && p->pdg_id() == 2212 ) continue;
4292 
4293  math::XYZVector vertex1;
4294  vertexId1 = -1;
4295 
4296  if(p->production_vertex() ) {
4297  vertex1.SetCoordinates( p->production_vertex()->position().x()/10.,
4298  p->production_vertex()->position().y()/10.,
4299  p->production_vertex()->position().z()/10. );
4300  vertexId1 = p->production_vertex()->barcode();
4301  }
4302 
4303  out.setf(std::ios::fixed, std::ios::floatfield);
4304  out.setf(std::ios::right, std::ios::adjustfield);
4305 
4306  out << std::setw(4) << p->barcode() << " "
4307  << name;
4308 
4309  for(unsigned int k=0;k<11-name.length() && k<12; k++) out << " ";
4310 
4311  double eta = momentum1.eta();
4312  if ( eta > +10. ) eta = +10.;
4313  if ( eta < -10. ) eta = -10.;
4314 
4315  out << std::setw(6) << std::setprecision(2) << eta << " "
4316  << std::setw(6) << std::setprecision(2) << momentum1.phi() << " "
4317  << std::setw(7) << std::setprecision(2) << momentum1.pt() << " "
4318  << std::setw(7) << std::setprecision(2) << momentum1.e() << " "
4319  << std::setw(4) << vertexId1 << " "
4320  << std::setw(6) << std::setprecision(1) << vertex1.x() << " "
4321  << std::setw(6) << std::setprecision(1) << vertex1.y() << " "
4322  << std::setw(6) << std::setprecision(1) << vertex1.z() << " ";
4323 
4324 
4325  if( p->production_vertex() ) {
4326  if ( p->production_vertex()->particles_in_size() ) {
4327  const HepMC::GenParticle* mother =
4328  *(p->production_vertex()->particles_in_const_begin());
4329 
4330  out << std::setw(4) << mother->barcode() << " ";
4331  }
4332  else
4333  out << " " ;
4334  }
4335 
4336  if ( p->end_vertex() ) {
4337  math::XYZTLorentzVector vertex2(p->end_vertex()->position().x()/10.,
4338  p->end_vertex()->position().y()/10.,
4339  p->end_vertex()->position().z()/10.,
4340  p->end_vertex()->position().t()/10.);
4341  int vertexId2 = p->end_vertex()->barcode();
4342 
4343  std::vector<const HepMC::GenParticle*> children;
4344  HepMC::GenVertex::particles_out_const_iterator firstDaughterIt =
4345  p->end_vertex()->particles_out_const_begin();
4346  HepMC::GenVertex::particles_out_const_iterator lastDaughterIt =
4347  p->end_vertex()->particles_out_const_end();
4348  for ( ; firstDaughterIt != lastDaughterIt ; ++firstDaughterIt ) {
4349  children.push_back(*firstDaughterIt);
4350  }
4351 
4352  out << std::setw(4) << vertexId2 << " "
4353  << std::setw(6) << std::setprecision(2) << vertex2.eta() << " "
4354  << std::setw(6) << std::setprecision(2) << vertex2.phi() << " "
4355  << std::setw(5) << std::setprecision(1) << vertex2.pt() << " "
4356  << std::setw(6) << std::setprecision(1) << vertex2.z() << " ";
4357 
4358  for ( unsigned id=0; id<children.size(); ++id )
4359  out << std::setw(4) << children[id]->barcode() << " ";
4360  }
4361  out << std::endl;
4362  }
4363 }
std::string getGenParticleName(int partId, std::string &latexStringName) const
get name of genParticle
T eta() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
int k[5][pyjets_maxn]
tuple out
Definition: dbtoconf.py:99
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:35
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
edm::HepMCProduct MCTruth_
tuple cout
Definition: gather_cfg.py:121
void PFRootEventManager::printMCCalib ( std::ofstream &  out) const

print calibration information

Definition at line 3863 of file PFRootEventManager.cc.

References deltaR(), genJets_, edm::HepMCProduct::GetEvent(), MCTruth_, pfJets_, mathSSE::sqrt(), and trueParticles_.

Referenced by processEntry().

3863  {
3864 
3865  if(!out) return;
3866  // if (!out.is_open()) return;
3867 
3868  // Use only for one PFSimParticle/GenParticles
3869  const HepMC::GenEvent* myGenEvent = MCTruth_.GetEvent();
3870  if(!myGenEvent) return;
3871  int nGen = 0;
3872  for ( HepMC::GenEvent::particle_const_iterator
3873  piter = myGenEvent->particles_begin();
3874  piter != myGenEvent->particles_end();
3875  ++piter ) nGen++;
3876  int nSim = trueParticles_.size();
3877  if ( nGen != 1 || nSim != 1 ) return;
3878 
3879  // One GenJet
3880  if ( genJets_.size() != 1 ) return;
3881  double true_E = genJets_[0].p();
3882  double true_eta = genJets_[0].eta();
3883  double true_phi = genJets_[0].phi();
3884 
3885  // One particle-flow jet
3886  // if ( pfJets_.size() != 1 ) return;
3887  double rec_ECALEnergy = 0.;
3888  double rec_HCALEnergy = 0.;
3889  double deltaRMin = 999.;
3890  unsigned int theJet = 0;
3891  for ( unsigned int ijet=0; ijet<pfJets_.size(); ++ijet ) {
3892  double rec_ECAL = pfJets_[ijet].neutralEmEnergy();
3893  double rec_HCAL = pfJets_[ijet].neutralHadronEnergy();
3894  double rec_eta = pfJets_[0].eta();
3895  double rec_phi = pfJets_[0].phi();
3896  double deltaR = std::sqrt( (rec_eta-true_eta)*(rec_eta-true_eta)
3897  + (rec_phi-true_phi)*(rec_phi-true_phi) );
3898  if ( deltaR < deltaRMin ) {
3899  deltaRMin = deltaR;
3900  rec_ECALEnergy = rec_ECAL;
3901  rec_HCALEnergy = rec_HCAL;
3902  }
3903  }
3904  if ( deltaRMin > 0.1 ) return;
3905 
3906  std::vector < PFCandidatePtr > constituents = pfJets_[theJet].getPFConstituents ();
3907  double pat_ECALEnergy = 0.;
3908  double pat_HCALEnergy = 0.;
3909  for (unsigned ic = 0; ic < constituents.size (); ++ic) {
3910  if ( constituents[ic]->particleId() < 4 ) continue;
3911  if ( constituents[ic]->particleId() == 4 )
3912  pat_ECALEnergy += constituents[ic]->rawEcalEnergy();
3913  else if ( constituents[ic]->particleId() == 5 )
3914  pat_HCALEnergy += constituents[ic]->rawHcalEnergy();
3915  }
3916 
3917  out << true_eta << " " << true_phi << " " << true_E
3918  << " " << rec_ECALEnergy << " " << rec_HCALEnergy
3919  << " " << pat_ECALEnergy << " " << pat_HCALEnergy
3920  << " " << deltaRMin << std::endl;
3921 }
reco::GenJetCollection genJets_
gen Jets
reco::PFSimParticleCollection trueParticles_
T sqrt(T t)
Definition: SSEVec.h:48
tuple out
Definition: dbtoconf.py:99
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:35
reco::PFJetCollection pfJets_
PF Jets.
edm::HepMCProduct MCTruth_
void PFRootEventManager::printRecHit ( const reco::PFRecHit rh,
unsigned  index,
const char *  seed = "    ",
std::ostream &  out = std::cout 
) const

Definition at line 4376 of file PFRootEventManager.cc.

References relval_parameters_module::energy, reco::PFRecHit::energy(), eta(), phi, reco::PFRecHit::position(), and printRecHitsEMin_.

Referenced by printRecHits().

4379  {
4380 
4381  if(!out) return;
4382  double eta = rh.position().Eta();
4383  double phi = rh.position().Phi();
4384  double energy = rh.energy();
4385 
4386  if(energy<printRecHitsEMin_) return;
4387 
4388  TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
4389  if( !cutg || cutg->IsInside( eta, phi ) )
4390  out<<index<<"\t"<<seedstatus<<" "<<rh<<endl;
4391 }
T eta() const
tuple out
Definition: dbtoconf.py:99
const math::XYZPoint & position() const
is seed ?
Definition: PFRecHit.h:141
double energy() const
rechit energy
Definition: PFRecHit.h:111
Definition: DDAxes.h:10
void PFRootEventManager::printRecHits ( const reco::PFRecHitCollection rechits,
const PFClusterAlgo clusterAlgo,
std::ostream &  out = std::cout 
) const

print rechits

Definition at line 4365 of file PFRootEventManager.cc.

References i, PFClusterAlgo::isSeed(), dbtoconf::out, and printRecHit().

Referenced by print().

4365  {
4366 
4367  for(unsigned i=0; i<rechits.size(); i++) {
4368  string seedstatus = " ";
4369  if(clusterAlgo.isSeed(i) )
4370  seedstatus = "SEED";
4371  printRecHit(rechits[i], i, seedstatus.c_str(), out);
4372  }
4373  return;
4374 }
int i
Definition: DBlmapReader.cc:9
bool isSeed(unsigned rhi) const
void printRecHit(const reco::PFRecHit &rh, unsigned index, const char *seed=" ", std::ostream &out=std::cout) const
tuple out
Definition: dbtoconf.py:99
bool PFRootEventManager::processEntry ( int  entry)
virtual

process one entry (pass the TTree entry)

Reimplemented in PFRootEventManagerColin, and MyPFRootEventManager.

Definition at line 1950 of file PFRootEventManager.cc.

References calibFile_, caloJetsCMSSW_, caloMetsCMSSW_, clustering(), clustersECAL_, clustersHCAL_, clustersHFEM_, clustersHFHAD_, clustersHO_, clustersPS_, convBremGsfrecTracks_, conversion_, corrcaloJetsCMSSW_, gather_cfg::cout, DeltaMETcut, DeltaPhicut, doClustering_, doCompare_, doJets_, doMet_, doParticleFlow_, doPFCandidateBenchmark_, doPFDQM_, doPFJetBenchmark_, doPFMETBenchmark_, doTauBenchmark_, ev_, edm::EventID::event(), eventAccepted(), PFJetMonitor::fill(), PFCandidateManager::fill(), PFMETMonitor::fillOne(), genJets_, genParticlesCMSSW_, gsfrecTracks_, edm::EventBase::id(), iEvent, iEvent_, JECinCaloMet_, edm::EventID::luminosityBlock(), MET1cut, metManager_, muons_, outEvent_, outTree_, particleFlow(), pfCandCompare(), pfCandidateManager_, pfCandidates_, PFJetBenchmark_, pfJetMonitor_, pfJets_, pfMETMonitor_, pfMetsCMSSW_, pfNuclearTrackerVertex_, primaryVertices_, print(), printMCCalib(), PFJetBenchmark::process(), readFromSimulation(), rechitsCLEANED_, rechitsECAL_, rechitsHCAL_, rechitsHFEM_, rechitsHFHAD_, rechitsHO_, rechitsPS_, reconstructCaloJets(), reconstructGenJets(), reconstructPFJets(), recTracks_, PFJetBenchmark::resChargedHadEnergyMax(), reset(), PFJetBenchmark::resNeutralEmEnergyMax(), PFJetBenchmark::resNeutralHadEnergyMax(), PFJetBenchmark::resPtMax(), edm::EventID::run(), EventColin::setNumber(), stdTracks_, tauBenchmark(), fwlite::ChainEvent::to(), trueParticles_, useHO_, v0_, VERBOSE, and verbosity_.

Referenced by DisplayManager::display(), DisplayManager::displayNextInteresting(), MyPFRootEventManager::processEntry(), PFRootEventManagerColin::processEntry(), and processEvent().

1950  {
1951 
1952  reset();
1953 
1954  iEvent_ = entry;
1955 
1956  bool exists = ev_->to(entry);
1957  if ( !exists ) {
1958  std::cout << "Entry " << entry << " does not exist " << std::endl;
1959  return false;
1960  }
1961  const edm::EventBase& iEvent = *ev_;
1962 
1964 
1965  if(verbosity_ == VERBOSE ||
1966  //entry < 10000 ||
1967  entry < 10 ||
1968  (entry < 100 && entry%10 == 0) ||
1969  (entry < 1000 && entry%100 == 0) ||
1970  entry%1000 == 0 )
1971  cout<<"process entry "<< entry
1972  <<", run "<<iEvent.id().run()
1973  <<", lumi "<<iEvent.id().luminosityBlock()
1974  <<", event:"<<iEvent.id().event()
1975  << endl;
1976 
1977  //ev_->getTFile()->cd();
1978 
1979  bool goodevent = readFromSimulation(entry);
1980 
1981  /*
1982  std::cout << "Rechits cleaned : " << std::endl;
1983  for(unsigned i=0; i<rechitsCLEANED_.size(); i++) {
1984  string seedstatus = " ";
1985  printRecHit(rechitsCLEANED_[i], i, seedstatus.c_str());
1986  }
1987  */
1988 
1989  if(verbosity_ == VERBOSE ) {
1990  cout<<"number of vertices : "<<primaryVertices_.size()<<endl;
1991  cout<<"number of recTracks : "<<recTracks_.size()<<endl;
1992  cout<<"number of gsfrecTracks : "<<gsfrecTracks_.size()<<endl;
1993  cout<<"number of convBremGsfrecTracks : "<<convBremGsfrecTracks_.size()<<endl;
1994  cout<<"number of muons : "<<muons_.size()<<endl;
1995  cout<<"number of displaced vertices : "<<pfNuclearTrackerVertex_.size()<<endl;
1996  cout<<"number of conversions : "<<conversion_.size()<<endl;
1997  cout<<"number of v0 : "<<v0_.size()<<endl;
1998  cout<<"number of stdTracks : "<<stdTracks_.size()<<endl;
1999  cout<<"number of true particles : "<<trueParticles_.size()<<endl;
2000  cout<<"number of ECAL rechits : "<<rechitsECAL_.size()<<endl;
2001  cout<<"number of HCAL rechits : "<<rechitsHCAL_.size()<<endl;
2002  cout<<"number of HO rechits : "<<rechitsHO_.size()<<endl;
2003  cout<<"number of HFEM rechits : "<<rechitsHFEM_.size()<<endl;
2004  cout<<"number of HFHAD rechits : "<<rechitsHFHAD_.size()<<endl;
2005  cout<<"number of HF Cleaned rechits : "<<rechitsCLEANED_.size()<<endl;
2006  cout<<"number of PS rechits : "<<rechitsPS_.size()<<endl;
2007  }
2008 
2009  if( doClustering_ ) {
2010  clustering();
2011 
2012  } else if( verbosity_ == VERBOSE ) {
2013  cout<<"clustering is OFF - clusters come from the input file"<<endl;
2014  }
2015 
2016  if(verbosity_ == VERBOSE ) {
2017  if(clustersECAL_.get() ) {
2018  cout<<"number of ECAL clusters : "<<clustersECAL_->size()<<endl;
2019  }
2020  if(clustersHCAL_.get() ) {
2021  cout<<"number of HCAL clusters : "<<clustersHCAL_->size()<<endl;
2022  }
2023 
2024  if(useHO_ && clustersHO_.get() ) {
2025  cout<<"number of HO clusters : "<<clustersHO_->size()<<endl;
2026  }
2027 
2028  if(clustersHFEM_.get() ) {
2029  cout<<"number of HFEM clusters : "<<clustersHFEM_->size()<<endl;
2030  }
2031  if(clustersHFHAD_.get() ) {
2032  cout<<"number of HFHAD clusters : "<<clustersHFHAD_->size()<<endl;
2033  }
2034  if(clustersPS_.get() ) {
2035  cout<<"number of PS clusters : "<<clustersPS_->size()<<endl;
2036  }
2037  }
2038 
2039  if(doParticleFlow_) {
2040  particleFlow();
2042  }
2043 
2044  if(doJets_) {
2048  }
2049 
2050  // call print() in verbose mode
2051  if( verbosity_ == VERBOSE ) print();
2052 
2053  //COLIN the PFJet and PFMET benchmarks are very messy.
2054  //COLIN compare with the filling of the PFCandidateBenchmark, which is one line.
2055 
2056  goodevent = eventAccepted();
2057 
2058  // evaluate PFJet Benchmark
2059  if(doPFJetBenchmark_) { // start PFJet Benchmark
2060 
2062  double resPt = PFJetBenchmark_.resPtMax();
2063  double resChargedHadEnergy = PFJetBenchmark_.resChargedHadEnergyMax();
2064  double resNeutralHadEnergy = PFJetBenchmark_.resNeutralHadEnergyMax();
2065  double resNeutralEmEnergy = PFJetBenchmark_.resNeutralEmEnergyMax();
2066 
2067  if( verbosity_ == VERBOSE ){ //start debug print
2068 
2069  cout << " =====================PFJetBenchmark =================" << endl;
2070  cout<<"Resol Pt max "<<resPt
2071  <<" resChargedHadEnergy Max " << resChargedHadEnergy
2072  <<" resNeutralHadEnergy Max " << resNeutralHadEnergy
2073  << " resNeutralEmEnergy Max "<< resNeutralEmEnergy << endl;
2074  } // end debug print
2075 
2076  // PJ : printout for bad events (selected by the "if")
2077  /*
2078  if ( fabs(resPt) > 0.4 )
2079  std::cout << "'" << iEvent.id().run() << ":" << iEvent.id().event() << "-"
2080  << iEvent.id().run() << ":" << iEvent.id().event() << "'," << std::endl;
2081  */
2082  if ( resPt < -1. ) {
2083  cout << " =====================PFJetBenchmark =================" << endl;
2084  cout<<"process entry "<< entry << endl;
2085  cout<<"Resol Pt max "<<resPt
2086  <<" resChargedHadEnergy Max " << resChargedHadEnergy
2087  <<" resNeutralHadEnergy Max " << resNeutralHadEnergy
2088  << " resNeutralEmEnergy Max "<< resNeutralEmEnergy
2089  << " Jet pt " << genJets_[0].pt() << endl;
2090  // return true;
2091  } else {
2092  // return false;
2093  }
2094  // if (resNeutralEmEnergy>0.5) return true;
2095  // else return false;
2096  }// end PFJet Benchmark
2097 
2098  // Addition to have DQM histograms : by S. Dutta
2099  reco::MET reComputedMet_;
2100  reco::MET computedGenMet_;
2101  //-----------------------------------------------
2102 
2103  //COLIN would be nice to move this long code to a separate function.
2104  // is it necessary to re-set everything at each event??
2105  if(doPFMETBenchmark_) { // start PFMet Benchmark
2106 
2107  // Fill here the various met benchmarks
2108  // pfMET vs GenMET
2109  metManager_->setMET1(&genParticlesCMSSW_);
2110  metManager_->setMET2(&pfMetsCMSSW_[0]);
2111  metManager_->FillHisto("PF");
2112  // cout events in tail
2113  metManager_->coutTailEvents(entry,DeltaMETcut,DeltaPhicut, MET1cut);
2114 
2115  // caloMET vs GenMET
2116  metManager_->setMET2(&caloMetsCMSSW_[0]);
2117  metManager_->FillHisto("Calo");
2118 
2119  if ( doMet_ ) {
2120  // recomputed pfMET vs GenMET
2121  metManager_->setMET2(*pfCandidates_);
2122  metManager_->FillHisto("recompPF");
2123  metManager_->coutTailEvents(entry,DeltaMETcut,DeltaPhicut, MET1cut);
2124  }
2125 
2126  if (JECinCaloMet_)
2127  {
2128  // corrCaloMET vs GenMET
2129  metManager_->setMET2(&caloMetsCMSSW_[0]);
2130  metManager_->propagateJECtoMET2(caloJetsCMSSW_, corrcaloJetsCMSSW_);
2131  metManager_->FillHisto("corrCalo");
2132  }
2133  }// end PFMET Benchmark
2134 
2135  if( goodevent && doPFCandidateBenchmark_ ) {
2137  }
2138 
2139  // Addition to have DQM histograms : by S. Dutta
2140  if( goodevent && doPFDQM_ ) {
2141  float deltaMin, deltaMax;
2142  pfJetMonitor_.fill( pfJets_, genJets_, deltaMin, deltaMax);
2143  if (doPFMETBenchmark_) {
2144  pfMETMonitor_.fillOne( reComputedMet_, computedGenMet_, deltaMin, deltaMax);
2145  }
2146  }
2147  //-----------------------------------------------
2148  // evaluate tau Benchmark
2149  if( goodevent && doTauBenchmark_) { // start tau Benchmark
2150  double deltaEt = 0.;
2151  deltaEt = tauBenchmark( *pfCandidates_ );
2152  if( verbosity_ == VERBOSE ) cout<<"delta E_t ="<<deltaEt <<endl;
2153  // cout<<"delta E_t ="<<deltaEt<<" delta E_t Other ="<<deltaEt1<<endl;
2154 
2155 
2156  // if( deltaEt>0.4 ) {
2157  // cout<<deltaEt<<endl;
2158  // return true;
2159  // }
2160  // else return false;
2161 
2162 
2163  } // end tau Benchmark
2164 
2165  if(goodevent && outTree_)
2166  outTree_->Fill();
2167 
2168  if(calibFile_)
2170 
2171  return goodevent;
2172 
2173 }
RunNumber_t run() const
Definition: EventID.h:42
bool doMet_
MET on/off.
EventNumber_t event() const
Definition: EventID.h:44
void reconstructGenJets()
reconstruct gen jets
void reset()
reset before next event
void reconstructPFJets()
reconstruct pf jets
PFMETMonitor pfMETMonitor_
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.
reco::PFMETCollection pfMetsCMSSW_
fwlite::ChainEvent * ev_
NEW: input event.
std::auto_ptr< reco::PFClusterCollection > clustersECAL_
void fill(const T &jetCollection, const C &matchedJetCollection, float &minVal, float &maxVal)
fill histograms with all particle
Definition: PFJetMonitor.h:67
reco::MuonCollection muons_
reco::GenJetCollection genJets_
gen Jets
reco::PFRecHitCollection rechitsHFHAD_
std::auto_ptr< reco::PFClusterCollection > clustersHCAL_
int iEvent_
current event
reco::PFRecTrackCollection recTracks_
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
bool doJets_
jets on/off
reco::PFRecHitCollection rechitsPS_
void particleFlow()
performs particle flow
void setNumber(int number)
Definition: EventColin.h:81
double tauBenchmark(const reco::PFCandidateCollection &candidates)
COLIN need to get rid of this mess.
bool doPFMETBenchmark_
PFMET benchmark on/off.
reco::PFRecHitCollection rechitsHCAL_
reco::PFSimParticleCollection trueParticles_
bool readFromSimulation(int entry)
read data from simulation tree
void print(std::ostream &out=std::cout, int maxNLines=-1) const
print information
int iEvent
Definition: GenABIO.cc:243
reco::VertexCollection primaryVertices_
TTree * outTree_
output tree
std::auto_ptr< reco::PFClusterCollection > clustersPS_
Definition: MET.h:32
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
PFJetMonitor pfJetMonitor_
std::ofstream * calibFile_
bool doParticleFlow_
particle flow on/off
double resPtMax() const
PFCandidateManager pfCandidateManager_
reco::GsfPFRecTrackCollection gsfrecTracks_
double resNeutralEmEnergyMax() const
double resNeutralHadEnergyMax() const
std::auto_ptr< reco::PFClusterCollection > clustersHO_
bool to(Long64_t iIndex)
Go to the event at index iIndex.
Definition: ChainEvent.cc:115
reco::PFRecHitCollection rechitsHFEM_
void clustering()
read data from testbeam tree
void process(const reco::PFJetCollection &, const reco::GenJetCollection &)
std::auto_ptr< reco::PFCandidateCollection > pfCandidates_
reconstructed pfCandidates
reco::PFRecHitCollection rechitsHO_
void fillOne(const reco::MET &met, const reco::MET &matchedMet, float &minVal, float &maxVal)
reco::GsfPFRecTrackCollection convBremGsfrecTracks_
reco::GenParticleCollection genParticlesCMSSW_
bool doTauBenchmark_
tau benchmark on/off
reco::PFJetCollection pfJets_
PF Jets.
std::auto_ptr< reco::PFClusterCollection > clustersHFEM_
double resChargedHadEnergyMax() const
bool eventAccepted() const
returns true if the event is accepted(have a look at the function implementation) ...
void printMCCalib(std::ofstream &out) const
print calibration information
reco::PFRecHitCollection rechitsCLEANED_
std::auto_ptr< reco::PFClusterCollection > clustersHFHAD_
reco::TrackCollection stdTracks_
reco::CaloMETCollection caloMetsCMSSW_
reco::PFDisplacedTrackerVertexCollection pfNuclearTrackerVertex_
bool doPFJetBenchmark_
PFJet benchmark on/off.
std::auto_ptr< METManager > metManager_
edm::EventID id() const
Definition: EventBase.h:56
bool useHO_
Use of HO in links with tracks/HCAL and in particle flow reconstruction.
void reconstructCaloJets()
reconstruct calo jets
void fill(const reco::PFCandidateCollection &candCollection, const C &matchedCandCollection)
fill histograms with all particle
std::vector< reco::CaloJet > corrcaloJetsCMSSW_
void pfCandCompare(int)
compare particle flow
reco::PFRecHitCollection rechitsECAL_
tuple cout
Definition: gather_cfg.py:121
double MET1cut
PFMET Benchmark.
int verbosity_
verbosity
reco::PFConversionCollection conversion_
std::vector< reco::CaloJet > caloJetsCMSSW_
bool JECinCaloMet_
propagate the Jet Energy Corrections to the caloMET on/off
bool doCompare_
comparison with pf CMSSW
reco::PFV0Collection v0_
bool PFRootEventManager::processEvent ( int  run,
int  lumi,
int  event 
)
virtual

process one event (pass the CMS event number)

Definition at line 1938 of file PFRootEventManager.cc.

References gather_cfg::cout, eventToEntry(), and processEntry().

Referenced by DisplayManager::displayEvent().

1938  {
1939 
1940  int entry = eventToEntry(run, lumi, event);
1941  if( entry < 0 ) {
1942  cout<<"event "<<event<<" is not present, sorry."<<endl;
1943  return false;
1944  }
1945  else
1946  return processEntry( entry );
1947 }
tuple lumi
Definition: fjr2json.py:35
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual bool processEntry(int entry)
process one entry (pass the TTree entry)
tuple cout
Definition: gather_cfg.py:121
int eventToEntry(int run, int lumi, int event) const
void PFRootEventManager::readCMSSWJets ( )

Definition at line 4593 of file PFRootEventManager.cc.

References caloJetsCMSSW_, gather_cfg::cout, genJetsCMSSW_, i, and pfJetsCMSSW_.

4593  {
4594 
4595  cout<<"CMSSW Gen jets : size = " << genJetsCMSSW_.size() << endl;
4596  for ( unsigned i = 0; i < genJetsCMSSW_.size(); i++) {
4597  cout<<"Gen jet Et : " << genJetsCMSSW_[i].et() << endl;
4598  }
4599  cout<<"CMSSW PF jets : size = " << pfJetsCMSSW_.size() << endl;
4600  for ( unsigned i = 0; i < pfJetsCMSSW_.size(); i++) {
4601  cout<<"PF jet Et : " << pfJetsCMSSW_[i].et() << endl;
4602  }
4603  cout<<"CMSSW Calo jets : size = " << caloJetsCMSSW_.size() << endl;
4604  for ( unsigned i = 0; i < caloJetsCMSSW_.size(); i++) {
4605  cout<<"Calo jet Et : " << caloJetsCMSSW_[i].et() << endl;
4606  }
4607 }
int i
Definition: DBlmapReader.cc:9
reco::PFJetCollection pfJetsCMSSW_
reco::GenJetCollection genJetsCMSSW_
tuple cout
Definition: gather_cfg.py:121
std::vector< reco::CaloJet > caloJetsCMSSW_
bool PFRootEventManager::readFromSimulation ( int  entry)

read data from simulation tree

Definition at line 2203 of file PFRootEventManager.cc.

References caloJetsCMSSW_, caloJetsHandle_, caloJetsTag_, caloMetsCMSSW_, caloMetsHandle_, caloMetsTag_, caloTowers_, caloTowersHandle_, caloTowersTag_, dtNoiseDBValidation_cfg::cerr, convBremGsfrecTracks_, convBremGsfrecTracksHandle_, convBremGsfrecTracksTag_, conversion_, conversionHandle_, conversionTag_, corrcaloJetsCMSSW_, corrcaloJetsHandle_, corrcaloJetsTag_, countChargedAndPhotons(), gather_cfg::cout, displacedRecTracks_, displacedRecTracksHandle_, displacedRecTracksTag_, doTauBenchmark_, egammaElectronHandle_, egammaElectrons_, egammaElectronsTag_, ev_, fillOutEventWithSimParticles(), filterHadronicTaus_, filterNParticles_, filterTaus_, findRecHitNeighbours_, genJetsCMSSW_, genJetsHandle_, genJetsTag_, genParticlesCMSSW_, genParticlesforJets_, genParticlesforJetsHandle_, genParticlesforJetsTag_, genParticlesforMETHandle_, genParticlesforMETTag_, edm::EventBase::getByLabel(), gsfrecTracks_, gsfrecTracksHandle_, gsfrecTracksTag_, i, iEvent, isHadronicTau(), j, MCTruth_, MCTruthHandle_, MCTruthTag_, muons_, muonsHandle_, muonsTag_, pfCandCMSSW_, pfCandidateHandle_, pfCandidateTag_, pfJetsCMSSW_, pfJetsHandle_, pfJetsTag_, pfMetsCMSSW_, pfMetsHandle_, pfMetsTag_, pfNuclearTrackerVertex_, pfNuclearTrackerVertexHandle_, pfNuclearTrackerVertexTag_, photonHandle_, photons_, photonTag_, PreprocessRecHits(), primaryVertices_, primaryVerticesHandle_, primaryVerticesTag_, rechitsCLEANED_, rechitsCLEANEDHandles_, rechitsCLEANEDTags_, rechitsCLEANEDV_, rechitsECAL_, rechitsECALHandle_, rechitsECALTag_, rechitsHCAL_, rechitsHCALHandle_, rechitsHCALTag_, rechitsHFEM_, rechitsHFEMHandle_, rechitsHFEMTag_, rechitsHFHAD_, rechitsHFHADHandle_, rechitsHFHADTag_, rechitsHO_, rechitsHOHandle_, rechitsHOTag_, rechitsPS_, rechitsPSHandle_, rechitsPSTag_, recTracks_, recTracksHandle_, recTracksTag_, findQualityFiles::size, stdTracks_, stdTracksHandle_, stdTracksTag_, tcMetsCMSSW_, tcMetsHandle_, tcMetsTag_, trueParticles_, trueParticlesHandle_, trueParticlesTag_, useConvBremGsfTracks_, useEGElectrons_, useEGPhotons_, useHO_, usePFConversions_, usePFNuclearInteractions_, usePFV0s_, v0_, v0Handle_, v0Tag_, VERBOSE, and verbosity_.

Referenced by processEntry().

2203  {
2204 
2205  if (verbosity_ == VERBOSE ) {
2206  cout <<"start reading from simulation"<<endl;
2207  }
2208 
2209 
2210  // if(!tree_) return false;
2211 
2212  const edm::EventBase& iEvent = *ev_;
2213 
2214 
2215  bool foundstdTracks = iEvent.getByLabel(stdTracksTag_,stdTracksHandle_);
2216  if ( foundstdTracks ) {
2218  // cout << "Found " << stdTracks_.size() << " standard tracks" << endl;
2219  } else {
2220  cerr<<"PFRootEventManager::ProcessEntry : stdTracks Collection not found : "
2221  <<entry << " " << stdTracksTag_<<endl;
2222  }
2223 
2224  bool foundMCTruth = iEvent.getByLabel(MCTruthTag_,MCTruthHandle_);
2225  if ( foundMCTruth ) {
2227  // cout << "Found MC truth" << endl;
2228  } else {
2229  // cerr<<"PFRootEventManager::ProcessEntry : MCTruth Collection not found : "
2230  // <<entry << " " << MCTruthTag_<<endl;
2231  }
2232 
2233  bool foundTP = iEvent.getByLabel(trueParticlesTag_,trueParticlesHandle_);
2234  if ( foundTP ) {
2236  // cout << "Found " << trueParticles_.size() << " true particles" << endl;
2237  } else {
2238  //cerr<<"PFRootEventManager::ProcessEntry : trueParticles Collection not found : "
2239  // <<entry << " " << trueParticlesTag_<<endl;
2240  }
2241 
2242  bool foundECAL = iEvent.getByLabel(rechitsECALTag_,rechitsECALHandle_);
2243  if ( foundECAL ) {
2245  // cout << "Found " << rechitsECAL_.size() << " ECAL rechits" << endl;
2246  } else {
2247  cerr<<"PFRootEventManager::ProcessEntry : rechitsECAL Collection not found : "
2248  <<entry << " " << rechitsECALTag_<<endl;
2249  }
2250 
2251  bool foundHCAL = iEvent.getByLabel(rechitsHCALTag_,rechitsHCALHandle_);
2252  if ( foundHCAL ) {
2254  // cout << "Found " << rechitsHCAL_.size() << " HCAL rechits" << endl;
2255  } else {
2256  cerr<<"PFRootEventManager::ProcessEntry : rechitsHCAL Collection not found : "
2257  <<entry << " " << rechitsHCALTag_<<endl;
2258  }
2259 
2260  if (useHO_) {
2261  bool foundHO = iEvent.getByLabel(rechitsHOTag_,rechitsHOHandle_);
2262  if ( foundHO ) {
2264  // cout << "Found " << rechitsHO_.size() << " HO rechits" << endl;
2265  } else {
2266  cerr<<"PFRootEventManager::ProcessEntry : rechitsHO Collection not found : "
2267  <<entry << " " << rechitsHOTag_<<endl;
2268  }
2269  }
2270 
2271  bool foundHFEM = iEvent.getByLabel(rechitsHFEMTag_,rechitsHFEMHandle_);
2272  if ( foundHFEM ) {
2274  // cout << "Found " << rechitsHFEM_.size() << " HFEM rechits" << endl;
2275  } else {
2276  cerr<<"PFRootEventManager::ProcessEntry : rechitsHFEM Collection not found : "
2277  <<entry << " " << rechitsHFEMTag_<<endl;
2278  }
2279 
2280  bool foundHFHAD = iEvent.getByLabel(rechitsHFHADTag_,rechitsHFHADHandle_);
2281  if ( foundHFHAD ) {
2283  // cout << "Found " << rechitsHFHAD_.size() << " HFHAD rechits" << endl;
2284  } else {
2285  cerr<<"PFRootEventManager::ProcessEntry : rechitsHFHAD Collection not found : "
2286  <<entry << " " << rechitsHFHADTag_<<endl;
2287  }
2288 
2289  for ( unsigned i=0; i<rechitsCLEANEDTags_.size(); ++i ) {
2290  bool foundCLEANED = iEvent.getByLabel(rechitsCLEANEDTags_[i],
2292  if ( foundCLEANED ) {
2294  // cout << "Found " << rechitsCLEANEDV_[i].size() << " CLEANED rechits" << endl;
2295  } else {
2296  cerr<<"PFRootEventManager::ProcessEntry : rechitsCLEANED Collection not found : "
2297  <<entry << " " << rechitsCLEANEDTags_[i]<<endl;
2298  }
2299 
2300  }
2301 
2302  bool foundPS = iEvent.getByLabel(rechitsPSTag_,rechitsPSHandle_);
2303  if ( foundPS ) {
2305  // cout << "Found " << rechitsPS_.size() << " PS rechits" << endl;
2306  } else {
2307  cerr<<"PFRootEventManager::ProcessEntry : rechitsPS Collection not found : "
2308  <<entry << " " << rechitsPSTag_<<endl;
2309  }
2310 
2311  bool foundCT = iEvent.getByLabel(caloTowersTag_,caloTowersHandle_);
2312  if ( foundCT ) {
2314  // cout << "Found " << caloTowers_.size() << " calo Towers" << endl;
2315  } else {
2316  cerr<<"PFRootEventManager::ProcessEntry : caloTowers Collection not found : "
2317  <<entry << " " << caloTowersTag_<<endl;
2318  }
2319 
2320  bool foundPV = iEvent.getByLabel(primaryVerticesTag_,primaryVerticesHandle_);
2321  if ( foundPV ) {
2323  // cout << "Found " << primaryVertices_.size() << " primary vertices" << endl;
2324  } else {
2325  cerr<<"PFRootEventManager::ProcessEntry : primaryVertices Collection not found : "
2326  <<entry << " " << primaryVerticesTag_<<endl;
2327  }
2328 
2329 
2331  if ( foundPFV ) {
2333  // cout << "Found " << pfNuclearTrackerVertex_.size() << " secondary PF vertices" << endl;
2334  } else if ( usePFNuclearInteractions_ ) {
2335  cerr<<"PFRootEventManager::ProcessEntry : pfNuclearTrackerVertex Collection not found : "
2336  <<entry << " " << pfNuclearTrackerVertexTag_<<endl;
2337  }
2338 
2339  bool foundrecTracks = iEvent.getByLabel(recTracksTag_,recTracksHandle_);
2340  if ( foundrecTracks ) {
2342  // cout << "Found " << recTracks_.size() << " PFRecTracks" << endl;
2343  } else {
2344  cerr<<"PFRootEventManager::ProcessEntry : recTracks Collection not found : "
2345  <<entry << " " << recTracksTag_<<endl;
2346  }
2347 
2348  bool founddisplacedRecTracks = iEvent.getByLabel(displacedRecTracksTag_,displacedRecTracksHandle_);
2349  if ( founddisplacedRecTracks ) {
2351  // cout << "Found " << displacedRecTracks_.size() << " PFRecTracks" << endl;
2352  } else {
2353  cerr<<"PFRootEventManager::ProcessEntry : displacedRecTracks Collection not found : "
2354  <<entry << " " << displacedRecTracksTag_<<endl;
2355  }
2356 
2357 
2358  bool foundgsfrecTracks = iEvent.getByLabel(gsfrecTracksTag_,gsfrecTracksHandle_);
2359  if ( foundgsfrecTracks ) {
2361  // cout << "Found " << gsfrecTracks_.size() << " GsfPFRecTracks" << endl;
2362  } else {
2363  cerr<<"PFRootEventManager::ProcessEntry : gsfrecTracks Collection not found : "
2364  <<entry << " " << gsfrecTracksTag_<<endl;
2365  }
2366 
2367  bool foundconvBremGsfrecTracks = iEvent.getByLabel(convBremGsfrecTracksTag_,convBremGsfrecTracksHandle_);
2368  if ( foundconvBremGsfrecTracks ) {
2370  // cout << "Found " << convBremGsfrecTracks_.size() << " ConvBremGsfPFRecTracks" << endl;
2371  } else if ( useConvBremGsfTracks_ ) {
2372  cerr<<"PFRootEventManager::ProcessEntry : convBremGsfrecTracks Collection not found : "
2373  <<entry << " " << convBremGsfrecTracksTag_<<endl;
2374  }
2375 
2376  bool foundmuons = iEvent.getByLabel(muonsTag_,muonsHandle_);
2377  if ( foundmuons ) {
2378  muons_ = *muonsHandle_;
2379  /*
2380  cout << "Found " << muons_.size() << " muons" << endl;
2381  for ( unsigned imu=0; imu<muons_.size(); ++imu ) {
2382  std::cout << " Muon " << imu << ":" << std::endl;
2383  reco::MuonRef muonref( &muons_, imu );
2384  PFMuonAlgo::printMuonProperties(muonref);
2385  }
2386  */
2387  } else {
2388  cerr<<"PFRootEventManager::ProcessEntry : muons Collection not found : "
2389  <<entry << " " << muonsTag_<<endl;
2390  }
2391 
2392  bool foundconversion = iEvent.getByLabel(conversionTag_,conversionHandle_);
2393  if ( foundconversion ) {
2395  // cout << "Found " << conversion_.size() << " conversion" << endl;
2396  } else if ( usePFConversions_ ) {
2397  cerr<<"PFRootEventManager::ProcessEntry : conversion Collection not found : "
2398  <<entry << " " << conversionTag_<<endl;
2399  }
2400 
2401 
2402 
2403  bool foundv0 = iEvent.getByLabel(v0Tag_,v0Handle_);
2404  if ( foundv0 ) {
2405  v0_ = *v0Handle_;
2406  // cout << "Found " << v0_.size() << " v0" << endl;
2407  } else if ( usePFV0s_ ) {
2408  cerr<<"PFRootEventManager::ProcessEntry : v0 Collection not found : "
2409  <<entry << " " << v0Tag_<<endl;
2410  }
2411 
2412  if(useEGPhotons_) {
2413  bool foundPhotons = iEvent.getByLabel(photonTag_,photonHandle_);
2414  if ( foundPhotons) {
2415  photons_ = *photonHandle_;
2416  } else {
2417  cerr <<"PFRootEventManager::ProcessEntry : photon collection not found : "
2418  << entry << " " << photonTag_ << endl;
2419  }
2420  }
2421 
2422  if(useEGElectrons_) {
2423  bool foundElectrons = iEvent.getByLabel(egammaElectronsTag_,egammaElectronHandle_);
2424  if ( foundElectrons) {
2425  // std::cout << " Found collection " << std::endl;
2427  } else
2428  {
2429  cerr <<"PFRootEventManager::ProcessEntry : electron collection not found : "
2430  << entry << " " << egammaElectronsTag_ << endl;
2431  }
2432  }
2433 
2434  bool foundgenJets = iEvent.getByLabel(genJetsTag_,genJetsHandle_);
2435  if ( foundgenJets ) {
2437  // cout << "Found " << genJetsCMSSW_.size() << " genJets" << endl;
2438  } else {
2439  //cerr<<"PFRootEventManager::ProcessEntry : genJets Collection not found : "
2440  // <<entry << " " << genJetsTag_<<endl;
2441  }
2442 
2443  bool foundgenParticlesforJets = iEvent.getByLabel(genParticlesforJetsTag_,genParticlesforJetsHandle_);
2444  if ( foundgenParticlesforJets ) {
2446  // cout << "Found " << genParticlesforJets_.size() << " genParticlesforJets" << endl;
2447  } else {
2448  //cerr<<"PFRootEventManager::ProcessEntry : genParticlesforJets Collection not found : "
2449  // <<entry << " " << genParticlesforJetsTag_<<endl;
2450  }
2451 
2452  bool foundgenParticlesforMET = iEvent.getByLabel(genParticlesforMETTag_,genParticlesforMETHandle_);
2453  if ( foundgenParticlesforMET ) {
2455  // cout << "Found " << genParticlesCMSSW_.size() << " genParticlesforMET" << endl;
2456  } else {
2457  //cerr<<"PFRootEventManager::ProcessEntry : genParticlesforMET Collection not found : "
2458  // <<entry << " " << genParticlesforMETTag_<<endl;
2459  }
2460 
2461  bool foundcaloJets = iEvent.getByLabel(caloJetsTag_,caloJetsHandle_);
2462  if ( foundcaloJets ) {
2464  // cout << "Found " << caloJetsCMSSW_.size() << " caloJets" << endl;
2465  } else {
2466  cerr<<"PFRootEventManager::ProcessEntry : caloJets Collection not found : "
2467  <<entry << " " << caloJetsTag_<<endl;
2468  }
2469 
2470  bool foundcorrcaloJets = iEvent.getByLabel(corrcaloJetsTag_,corrcaloJetsHandle_);
2471  if ( foundcorrcaloJets ) {
2473  // cout << "Found " << corrcaloJetsCMSSW_.size() << " corrcaloJets" << endl;
2474  } else {
2475  //cerr<<"PFRootEventManager::ProcessEntry : corrcaloJets Collection not found : "
2476  // <<entry << " " << corrcaloJetsTag_<<endl;
2477  }
2478 
2479  bool foundpfJets = iEvent.getByLabel(pfJetsTag_,pfJetsHandle_);
2480  if ( foundpfJets ) {
2482  // cout << "Found " << pfJetsCMSSW_.size() << " PFJets" << endl;
2483  } else {
2484  cerr<<"PFRootEventManager::ProcessEntry : PFJets Collection not found : "
2485  <<entry << " " << pfJetsTag_<<endl;
2486  }
2487 
2488  bool foundpfCands = iEvent.getByLabel(pfCandidateTag_,pfCandidateHandle_);
2489  if ( foundpfCands ) {
2491  // cout << "Found " << pfCandCMSSW_.size() << " PFCandidates" << endl;
2492  } else {
2493  cerr<<"PFRootEventManager::ProcessEntry : PFCandidate Collection not found : "
2494  <<entry << " " << pfCandidateTag_<<endl;
2495  }
2496 
2497  bool foundpfMets = iEvent.getByLabel(pfMetsTag_,pfMetsHandle_);
2498  if ( foundpfMets ) {
2500  //cout << "Found " << pfMetsCMSSW_.size() << " PFMets" << endl;
2501  } else {
2502  cerr<<"PFRootEventManager::ProcessEntry : PFMets Collection not found : "
2503  <<entry << " " << pfMetsTag_<<endl;
2504  }
2505 
2506  bool foundtcMets = iEvent.getByLabel(tcMetsTag_,tcMetsHandle_);
2507  if ( foundtcMets ) {
2509  //cout << "Found " << tcMetsCMSSW_.size() << " TCMets" << endl;
2510  } else {
2511  cerr<<"TCRootEventManager::ProcessEntry : TCMets Collection not found : "
2512  <<entry << " " << tcMetsTag_<<endl;
2513  }
2514 
2515  bool foundcaloMets = iEvent.getByLabel(caloMetsTag_,caloMetsHandle_);
2516  if ( foundcaloMets ) {
2518  //cout << "Found " << caloMetsCMSSW_.size() << " CALOMets" << endl;
2519  } else {
2520  cerr<<"CALORootEventManager::ProcessEntry : CALOMets Collection not found : "
2521  <<entry << " " << caloMetsTag_<<endl;
2522  }
2523 
2524  // now can use the tree
2525 
2526  bool goodevent = true;
2527  if(trueParticles_.size() ) {
2528  // this is a filter to select single particle events.
2530  trueParticles_.size() != filterNParticles_ ) {
2531  cout << "PFRootEventManager : event discarded Nparticles="
2532  <<filterNParticles_<< endl;
2533  goodevent = false;
2534  }
2535  if(goodevent && doTauBenchmark_ && filterHadronicTaus_ && !isHadronicTau() ) {
2536  cout << "PFRootEventManager : leptonic tau discarded " << endl;
2537  goodevent = false;
2538  }
2539  if( goodevent && doTauBenchmark_ && !filterTaus_.empty()
2540  && !countChargedAndPhotons() ) {
2541  assert( filterTaus_.size() == 2 );
2542  cout <<"PFRootEventManager : tau discarded: "
2543  <<"number of charged and neutral particles different from "
2544  <<filterTaus_[0]<<","<<filterTaus_[1]<<endl;
2545  goodevent = false;
2546  }
2547 
2548  if(goodevent)
2550 
2551  }
2552 
2553  // if(caloTowersBranch_) {
2554  // if(goodevent)
2555  // fillOutEventWithCaloTowers( caloTowers_ );
2556  // }
2557 
2558  if(rechitsECAL_.size()) {
2560  }
2561  if(rechitsHCAL_.size()) {
2563  }
2564 
2565  if (useHO_) {
2566  if(rechitsHO_.size()) {
2568  }
2569  }
2570 
2571  if(rechitsHFEM_.size()) {
2573  }
2574  if(rechitsHFHAD_.size()) {
2576  }
2577  rechitsCLEANED_.clear();
2578  for ( unsigned i=0; i<rechitsCLEANEDV_.size(); ++i ) {
2579  if(rechitsCLEANEDV_[i].size()) {
2580  PreprocessRecHits( rechitsCLEANEDV_[i] , false);
2581  for ( unsigned j=0; j<rechitsCLEANEDV_[i].size(); ++j ) {
2582  rechitsCLEANED_.push_back( (rechitsCLEANEDV_[i])[j] );
2583  }
2584  }
2585  }
2586 
2587  if(rechitsPS_.size()) {
2589  }
2590 
2591  /*
2592  if ( recTracks_.size() ) {
2593  PreprocessRecTracks( recTracks_);
2594  }
2595 
2596  if ( displacedRecTracks_.size() ) {
2597  // cout << "preprocessing rec tracks" << endl;
2598  PreprocessRecTracks( displacedRecTracks_);
2599  }
2600 
2601 
2602  if(gsfrecTracks_.size()) {
2603  PreprocessRecTracks( gsfrecTracks_);
2604  }
2605 
2606  if(convBremGsfrecTracks_.size()) {
2607  PreprocessRecTracks( convBremGsfrecTracks_);
2608  }
2609  */
2610 
2611  return goodevent;
2612 }
edm::InputTag displacedRecTracksTag_
CaloTowerCollection caloTowers_
edm::InputTag MCTruthTag_
edm::Handle< reco::CaloMETCollection > caloMetsHandle_
CMSSW Calo MET.
int i
Definition: DBlmapReader.cc:9
edm::Handle< reco::GenParticleRefVector > genParticlesforJetsHandle_
input collection of gen particles
edm::Handle< reco::PFRecHitCollection > rechitsHFEMHandle_
rechits HF EM
edm::Handle< reco::PFJetCollection > pfJetsHandle_
CMSSW PF Jets.
reco::PFMETCollection pfMetsCMSSW_
edm::InputTag caloJetsTag_
edm::Handle< reco::PFCandidateCollection > pfCandidateHandle_
CMSSW PF candidates.
reco::GenParticleRefVector genParticlesforJets_
edm::InputTag convBremGsfrecTracksTag_
edm::Handle< reco::PFRecHitCollection > rechitsHCALHandle_
rechits HCAL
edm::Handle< reco::PFMETCollection > pfMetsHandle_
CMSSW PF MET.
fwlite::ChainEvent * ev_
NEW: input event.
reco::PFJetCollection pfJetsCMSSW_
void PreprocessRecHits(reco::PFRecHitCollection &rechits, bool findNeighbours)
preprocess a rechit vector from a given rechit branch
bool usePFV0s_
Use of V0 in PFAlgo.
reco::MuonCollection muons_
edm::InputTag stdTracksTag_
reco::PFRecTrackCollection displacedRecTracks_
edm::InputTag egammaElectronsTag_
reco::PFRecHitCollection rechitsHFHAD_
edm::InputTag photonTag_
edm::InputTag primaryVerticesTag_
edm::InputTag rechitsHFEMTag_
edm::InputTag rechitsECALTag_
bool usePFNuclearInteractions_
Use of PFDisplacedVertex in PFAlgo.
bool isHadronicTau() const
study the sim event to check if the tau decay is hadronic
reco::PhotonCollection photons_
reco::PFRecTrackCollection recTracks_
edm::Handle< reco::GsfPFRecTrackCollection > gsfrecTracksHandle_
reconstructed GSF tracks
reco::PFRecHitCollection rechitsPS_
edm::Handle< reco::PhotonCollection > photonHandle_
photons
edm::InputTag pfMetsTag_
edm::Handle< std::vector< reco::CaloJet > > caloJetsHandle_
CMSSW calo Jets.
reco::PFRecHitCollection rechitsHCAL_
edm::InputTag gsfrecTracksTag_
edm::Handle< reco::PFRecHitCollection > rechitsECALHandle_
rechits ECAL
edm::Handle< reco::PFRecHitCollection > rechitsHFHADHandle_
rechits HF HAD
std::vector< edm::Handle< reco::PFRecHitCollection > > rechitsCLEANEDHandles_
reco::PFSimParticleCollection trueParticles_
edm::Handle< reco::PFSimParticleCollection > trueParticlesHandle_
true particles
edm::Handle< reco::TrackCollection > stdTracksHandle_
standard reconstructed tracks
std::vector< int > filterTaus_
edm::InputTag rechitsPSTag_
int iEvent
Definition: GenABIO.cc:243
edm::Handle< reco::GenJetCollection > genJetsHandle_
CMSSW gen Jets.
reco::VertexCollection primaryVertices_
edm::InputTag genParticlesforMETTag_
edm::InputTag rechitsHOTag_
reco::GenJetCollection genJetsCMSSW_
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
edm::InputTag pfNuclearTrackerVertexTag_
edm::InputTag corrcaloJetsTag_
edm::InputTag genParticlesforJetsTag_
edm::InputTag caloTowersTag_
int j
Definition: DBlmapReader.cc:9
edm::InputTag recTracksTag_
reco::PFCandidateCollection pfCandCMSSW_
reco::GsfPFRecTrackCollection gsfrecTracks_
edm::InputTag genJetsTag_
bool usePFConversions_
Use of conversions in PFAlgo.
bool findRecHitNeighbours_
find rechit neighbours ?
edm::InputTag pfJetsTag_
reco::PFRecHitCollection rechitsHFEM_
std::vector< reco::PFRecHitCollection > rechitsCLEANEDV_
rechits HF CLEANED
edm::Handle< reco::PFRecHitCollection > rechitsHOHandle_
rechits HO
edm::InputTag rechitsHFHADTag_
void fillOutEventWithSimParticles(const reco::PFSimParticleCollection &ptcs)
fills OutEvent with sim particles
bool countChargedAndPhotons() const
reco::PFRecHitCollection rechitsHO_
edm::Handle< reco::PFConversionCollection > conversionHandle_
conversions
reco::GsfPFRecTrackCollection convBremGsfrecTracks_
edm::Handle< reco::GsfElectronCollection > egammaElectronHandle_
reco::GenParticleCollection genParticlesCMSSW_
edm::Handle< reco::GenParticleCollection > genParticlesforMETHandle_
CMSSW GenParticles.
bool doTauBenchmark_
tau benchmark on/off
edm::InputTag caloMetsTag_
edm::InputTag rechitsHCALTag_
reco::PFRecHitCollection rechitsCLEANED_
edm::Handle< CaloTowerCollection > caloTowersHandle_
input collection of calotowers
reco::TrackCollection stdTracks_
reco::CaloMETCollection caloMetsCMSSW_
edm::Handle< edm::HepMCProduct > MCTruthHandle_
MC truth.
reco::PFDisplacedTrackerVertexCollection pfNuclearTrackerVertex_
edm::HepMCProduct MCTruth_
edm::Handle< reco::METCollection > tcMetsHandle_
CMSSW TCMET.
edm::Handle< reco::PFDisplacedTrackerVertexCollection > pfNuclearTrackerVertexHandle_
PFDisplacedVertex.
edm::Handle< reco::VertexCollection > primaryVerticesHandle_
reconstructed primary vertices
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:86
bool useHO_
Use of HO in links with tracks/HCAL and in particle flow reconstruction.
edm::InputTag conversionTag_
edm::Handle< reco::PFRecTrackCollection > displacedRecTracksHandle_
edm::Handle< reco::PFRecHitCollection > rechitsPSHandle_
rechits PS
edm::Handle< std::vector< reco::CaloJet > > corrcaloJetsHandle_
CMSSW corrected calo Jets.
edm::Handle< reco::GsfPFRecTrackCollection > convBremGsfrecTracksHandle_
reconstructed secondary GSF tracks
edm::Handle< reco::PFV0Collection > v0Handle_
V0.
bool useConvBremGsfTracks_
Use Secondary Gsf Tracks.
std::vector< reco::CaloJet > corrcaloJetsCMSSW_
edm::InputTag pfCandidateTag_
reco::PFRecHitCollection rechitsECAL_
tuple cout
Definition: gather_cfg.py:121
int verbosity_
verbosity
reco::PFConversionCollection conversion_
edm::InputTag tcMetsTag_
std::vector< reco::CaloJet > caloJetsCMSSW_
reco::METCollection tcMetsCMSSW_
bool useEGElectrons_
Use EGElectrons.
bool useEGPhotons_
Use EGPhotons.
tuple size
Write out results.
edm::Handle< reco::MuonCollection > muonsHandle_
muons
reco::GsfElectronCollection egammaElectrons_
std::vector< edm::InputTag > rechitsCLEANEDTags_
edm::InputTag trueParticlesTag_
edm::Handle< reco::PFRecTrackCollection > recTracksHandle_
reconstructed tracks
reco::PFV0Collection v0_
void PFRootEventManager::readOptions ( const char *  file,
bool  refresh = true,
bool  reconnect = false 
)

parse option file if(reconnect), the rootfile will be reopened, and the tree reconnected

Definition at line 132 of file PFRootEventManager.cc.

References calibFile_, calibration_, dtNoiseDBValidation_cfg::cerr, clusterAlgoECAL_, clusterAlgoHCAL_, clusterAlgoHFEM_, clusterAlgoHFHAD_, clusterAlgoHO_, clusterAlgoPS_, connect(), gather_cfg::cout, debug_, Benchmark::DEFAULT, DeltaMETcut, DeltaPhicut, deltaRMax, dir, doClustering_, doCompare_, doJets_, doMet_, doParticleFlow_, doPFCandidateBenchmark_, doPFDQM_, doPFJetBenchmark_, doPFMETBenchmark_, doTauBenchmark_, dqmFile_, egammaElectronsTag_, PFClusterAlgo::enableDebugging(), cppFunctionSkipper::exception, cmsRelvalreport::exit, expand(), fastsim_, timingPdfMaker::file1, filterHadronicTaus_, filterNParticles_, filterTaus_, findRecHitNeighbours_, IO::GetOpt(), JECinCaloMet_, jetAlgo_, jetAlgoType_, jetMaker_, jetsDebug_, MET1cut, metManager_, align_cfg::minTrackerHits, alignBH_cfg::mode, onlyTwoJets, options_, outEvent_, outFile_, EcalCondDB::outfilename, outjetfilename, outTree_, pfAlgo_, pfBlockAlgo_, pfCandidateManager_, pfjBenchmarkDebug, PFJetBenchmark_, pfJetMonitor_, pfMETMonitor_, plotAgainstReco, printClusters_, printClustersEMin_, printGenParticles_, printGenParticlesPtMin_, printMCTruthMatching_, printPFBlocks_, printPFCandidates_, printPFCandidatesPtMin_, printPFJets_, printPFJetsPtMin_, printRecHits_, printRecHitsEMin_, printSimParticles_, printSimParticlesPtMin_, PtMinSelector_cfg::ptMin, readSpecificOptions(), reset(), PFAlgo::setAlgo(), PFAlgo::setCandConnectorParameters(), PFClusterAlgo::setCleanRBXandHPDs(), PFJetAlgorithm::SetConeAngle(), FWLiteJetProducer::setConeAreaFraction(), PFJetAlgorithm::SetConeMerge(), FWLiteJetProducer::setConeRadius(), PFAlgo::setDebug(), FWLiteJetProducer::setDebug(), PFBlockAlgo::setDebug(), reco::PFCluster::setDepthCorParameters(), PFMETMonitor::setDirectory(), PFJetMonitor::setDirectory(), PFCandidateManager::setDirectory(), PFAlgo::setDisplacedVerticesParameters(), PFClusterAlgo::setHistos(), PFAlgo::setHOTag(), PFBlockAlgo::setHOTag(), FWLiteJetProducer::setMaxIterations(), FWLiteJetProducer::setMaxPairSize(), FWLiteJetProducer::setmEInputCut(), FWLiteJetProducer::setmEtInputCut(), PFClusterAlgo::setNNeighbours(), FWLiteJetProducer::setOverlapThreshold(), PFMETMonitor::setParameters(), PFJetMonitor::setParameters(), PFCandidateManager::setParameters(), PFAlgo::setParameters(), PFBlockAlgo::setParameters(), PFAlgo::setPFEleParameters(), PFAlgo::setPFMuonAndFakeParameters(), PFAlgo::setPFPhotonParameters(), PFAlgo::setPFPhotonRegWeights(), PFClusterAlgo::setPosCalcNCrystal(), PFClusterAlgo::setPosCalcP1(), PFAlgo::setPostHFCleaningParameters(), FWLiteJetProducer::setPtMin(), Benchmark::setRange(), FWLiteJetProducer::setRParam(), PFClusterAlgo::setS4S1CleanBarrel(), PFClusterAlgo::setS4S1CleanEndcap(), PFClusterAlgo::setS6S2DoubleSpikeBarrel(), PFClusterAlgo::setS6S2DoubleSpikeEndcap(), PFJetAlgorithm::SetSeedEt(), FWLiteJetProducer::setSeedThreshold(), PFClusterAlgo::setShowerSigma(), PFClusterAlgo::setThreshBarrel(), PFClusterAlgo::setThreshCleanBarrel(), PFClusterAlgo::setThreshCleanEndcap(), PFClusterAlgo::setThreshDoubleSpikeBarrel(), PFClusterAlgo::setThreshDoubleSpikeEndcap(), PFClusterAlgo::setThreshEndcap(), PFClusterAlgo::setThreshPtBarrel(), PFClusterAlgo::setThreshPtEndcap(), PFClusterAlgo::setThreshPtSeedBarrel(), PFClusterAlgo::setThreshPtSeedEndcap(), PFClusterAlgo::setThreshSeedBarrel(), PFClusterAlgo::setThreshSeedEndcap(), PFMETMonitor::setup(), PFJetMonitor::setup(), PFJetBenchmark::setup(), PFCandidateManager::setup(), PFClusterAlgo::setUseCornerCells(), PFBlockAlgo::setUseOptimization(), AlCaHLTBitMon_QueryRunRegistry::string, tauBenchmarkDebug_, thepfEnergyCalibrationHF_, TrackQuality_cff::trackQuality, FWLiteJetProducer::updateParameter(), useAtHLT_, useConvBremPFRecTracks_, useEGElectrons_, useEGPhotons_, useHO_, useKDTreeTrackEcalLinker_, usePFElectrons_, VERBOSE, and verbosity_.

Referenced by PFRootEventManager().

134  {
135 
137 
138  cout<<"calling PFRootEventManager::readOptions"<<endl;
139 
140 
141  reset();
142 
143  PFGeometry pfGeometry; // initialize geometry
144 
145  // cout<<"reading options "<<endl;
146 
147  try {
148  if( !options_ )
149  options_ = new IO(file);
150  else if( refresh) {
151  delete options_;
152  options_ = new IO(file);
153  }
154  }
155  catch( const string& err ) {
156  cout<<err<<endl;
157  return;
158  }
159 
160 
161  debug_ = false;
162  options_->GetOpt("rootevent", "debug", debug_);
163 
164 
165  // output text file for calibration
166  string calibfilename;
167  options_->GetOpt("calib","outfile",calibfilename);
168  if (!calibfilename.empty()) {
169  calibFile_ = new std::ofstream(calibfilename.c_str());
170  std::cout << "Calib file name " << calibfilename << " " << calibfilename.c_str() << std::endl;
171  }
172 
173  // output root file ------------------------------------------
174 
175 
176  if(!outFile_) {
177  string outfilename;
178  options_->GetOpt("root","outfile", outfilename);
179  bool doOutTree = false;
180  options_->GetOpt("root","outtree", doOutTree);
181  if(doOutTree) {
182  if(!outfilename.empty() ) {
183  outFile_ = TFile::Open(outfilename.c_str(), "recreate");
184 
185  outFile_->cd();
186  //options_->GetOpt("root","outtree", doOutTree);
187  //if(doOutTree) {
188  // cout<<"do tree"<<endl;
189  outEvent_ = new EventColin();
190  outTree_ = new TTree("Eff","");
191  outTree_->Branch("event","EventColin", &outEvent_,32000,2);
192  }
193  // cout<<"don't do tree"<<endl;
194  }
195  }
196  // PFJet benchmark options and output jetfile to be open before input file!!!--
197 
198  doPFJetBenchmark_ = false;
199  options_->GetOpt("pfjet_benchmark", "on/off", doPFJetBenchmark_);
200 
201  if (doPFJetBenchmark_) {
202  string outjetfilename;
203  options_->GetOpt("pfjet_benchmark", "outjetfile", outjetfilename);
204 
205  bool pfjBenchmarkDebug;
206  options_->GetOpt("pfjet_benchmark", "debug", pfjBenchmarkDebug);
207 
208  bool plotAgainstReco=0;
209  options_->GetOpt("pfjet_benchmark", "plotAgainstReco", plotAgainstReco);
210 
211  bool onlyTwoJets=1;
212  options_->GetOpt("pfjet_benchmark", "onlyTwoJets", onlyTwoJets);
213 
214  double deltaRMax=0.1;
215  options_->GetOpt("pfjet_benchmark", "deltaRMax", deltaRMax);
216 
217  fastsim_=true;
218  options_->GetOpt("Simulation","Fast",fastsim_);
219 
220  PFJetBenchmark_.setup( outjetfilename,
221  pfjBenchmarkDebug,
222  plotAgainstReco,
223  onlyTwoJets,
224  deltaRMax );
225  }
226 
227 // PFMET benchmark options and output jetfile to be open before input file!!!--
228 
229  doPFMETBenchmark_ = false;
230  options_->GetOpt("pfmet_benchmark", "on/off", doPFMETBenchmark_);
231 
232  if (doPFMETBenchmark_) {
233  //COLIN : looks like this benchmark is not written in the standard output file. Any particular reason for it?
234 
235  doMet_ = false;
236  options_->GetOpt("MET", "on/off", doMet_);
237 
238  JECinCaloMet_ = false;
239  options_->GetOpt("pfmet_benchmark", "JECinCaloMET", JECinCaloMet_);
240 
241  std::string outmetfilename;
242  options_->GetOpt("pfmet_benchmark", "outmetfile", outmetfilename);
243 
244  // define here the various benchmark comparison
245  metManager_.reset( new METManager(outmetfilename) );
246  metManager_->addGenBenchmark("PF");
247  metManager_->addGenBenchmark("Calo");
248  if ( doMet_ ) metManager_->addGenBenchmark("recompPF");
249  if (JECinCaloMet_) metManager_->addGenBenchmark("corrCalo");
250 
251  bool pfmetBenchmarkDebug;
252  options_->GetOpt("pfmet_benchmark", "debug", pfmetBenchmarkDebug);
253 
254  MET1cut = 10.0;
255  options_->GetOpt("pfmet_benchmark", "truemetcut", MET1cut);
256 
257  DeltaMETcut = 30.0;
258  options_->GetOpt("pfmet_benchmark", "deltametcut", DeltaMETcut);
259 
260  DeltaPhicut = 0.8;
261  options_->GetOpt("pfmet_benchmark", "deltaphicut", DeltaPhicut);
262 
263 
264  std::vector<unsigned int> vIgnoreParticlesIDs;
265  options_->GetOpt("pfmet_benchmark", "trueMetIgnoreParticlesIDs", vIgnoreParticlesIDs);
266  //std::cout << "FL: vIgnoreParticlesIDs.size() = " << vIgnoreParticlesIDs.size() << std::endl;
267  //std::cout << "FL: first = " << vIgnoreParticlesIDs[0] << std::endl;
268  metManager_->SetIgnoreParticlesIDs(&vIgnoreParticlesIDs);
269 
270  std::vector<unsigned int> trueMetSpecificIdCut;
271  std::vector<double> trueMetSpecificEtaCut;
272  options_->GetOpt("pfmet_benchmark", "trueMetSpecificIdCut", trueMetSpecificIdCut);
273  options_->GetOpt("pfmet_benchmark", "trueMetSpecificEtaCut", trueMetSpecificEtaCut);
274  if (trueMetSpecificIdCut.size()!=trueMetSpecificEtaCut.size()) std::cout << "Warning: PFRootEventManager: trueMetSpecificIdCut.size()!=trueMetSpecificEtaCut.size()" << std::endl;
275  else metManager_->SetSpecificIdCut(&trueMetSpecificIdCut,&trueMetSpecificEtaCut);
276 
277  }
278 
280  options_->GetOpt("pfCandidate_benchmark", "on/off", doPFCandidateBenchmark_);
282  cout<<"+++ Setting PFCandidate benchmark"<<endl;
283  TDirectory* dir = outFile_->mkdir("DQMData");
284  dir = dir->mkdir("PFTask");
285  dir = dir->mkdir("particleFlowManager");
287 
288  float dRMax = 0.5;
289  options_->GetOpt("pfCandidate_benchmark", "dRMax", dRMax);
290  float ptMin = 2;
291  options_->GetOpt("pfCandidate_benchmark", "ptMin", ptMin);
292  bool matchCharge = true;
293  options_->GetOpt("pfCandidate_benchmark", "matchCharge", matchCharge);
294  int mode = static_cast<int>(Benchmark::DEFAULT);
295  options_->GetOpt("pfCandidate_benchmark", "mode", mode);
296 
297  pfCandidateManager_.setParameters( dRMax, matchCharge,
298  static_cast<Benchmark::Mode>(mode));
299  pfCandidateManager_.setRange( ptMin, 10e5, -4.5, 4.5, -10, 10);
301  //COLIN need to set the subdirectory.
302  cout<<"+++ Done "<<endl;
303  }
304  // Addition to have DQM histograms : by S. Dutta
305  doPFDQM_ = true;
306  options_->GetOpt("pfDQM_monitor", "on/off", doPFDQM_);
307 
308  if (doPFDQM_) {
309  cout<<"+++ Setting PFDQM Monitoring " <<endl;
310  string dqmfilename;
311  dqmFile_ = 0;
312  options_->GetOpt("pfDQM_monitor","DQMFilename", dqmfilename);
313  dqmFile_ = TFile::Open(dqmfilename.c_str(), "recreate");
314 
315  TDirectory* dir = dqmFile_->mkdir("DQMData");
316  TDirectory* dir1 = dir->mkdir("PFJetValidation");
317  TDirectory* dir2 = dir->mkdir("PFMETValidation");
318  pfJetMonitor_.setDirectory( dir1 );
319  pfMETMonitor_.setDirectory( dir2 );
320  float dRMax = 0.5;
321  options_->GetOpt("pfCandidate_benchmark", "dRMax", dRMax);
322  float ptMin = 2;
323  options_->GetOpt("pfCandidate_benchmark", "ptMin", ptMin);
324  bool matchCharge = true;
325  options_->GetOpt("pfCandidate_benchmark", "matchCharge", matchCharge);
326  int mode = static_cast<int>(Benchmark::DEFAULT);
327  options_->GetOpt("pfCandidate_benchmark", "mode", mode);
328 
329  pfJetMonitor_.setParameters( dRMax, matchCharge, static_cast<Benchmark::Mode>(mode),
330  ptMin, 10e5, -4.5, 4.5, -10.0, 10.0, false);
332 
333  pfMETMonitor_.setParameters( static_cast<Benchmark::Mode>(mode),
334  ptMin, 10e5, -4.5, 4.5, -10.0, 10.0, false);
336  }
337 //-----------------------------------------------
338 
339 
340  std::string outputFile0;
341  TFile* file0 = 0;
342  TH2F* hBNeighbour0 = 0;
343  TH2F* hENeighbour0 = 0;
344  options_->GetOpt("clustering", "ECAL", outputFile0);
345  if(!outputFile0.empty() ) {
346  file0 = TFile::Open(outputFile0.c_str(),"recreate");
347  hBNeighbour0 = new TH2F("BNeighbour0","f_{Neighbours} vs 1/E_{Seed} (ECAL Barrel)",500, 0., 0.5, 1000,0.,1.);
348  hENeighbour0 = new TH2F("ENeighbour0","f_{Neighbours} vs 1/E_{Seed} (ECAL Endcap)",500, 0., 0.2, 1000,0.,1.);
349  }
350 
351  std::string outputFile1;
352  TFile* file1 = 0;
353  TH2F* hBNeighbour1 = 0;
354  TH2F* hENeighbour1 = 0;
355  options_->GetOpt("clustering", "HCAL", outputFile1);
356  if(!outputFile1.empty() ) {
357  file1 = TFile::Open(outputFile1.c_str(),"recreate");
358  hBNeighbour1 = new TH2F("BNeighbour1","f_{Neighbours} vs 1/E_{Seed} (HCAL Barrel)",500, 0., 0.05, 400,0.,1.);
359  hENeighbour1 = new TH2F("ENeighbour1","f_{Neighbours} vs 1/E_{Seed} (HCAL Endcap)",500, 0., 0.05, 400,0.,1.);
360  }
361 
362  std::string outputFile2;
363  TFile* file2 = 0;
364  TH2F* hBNeighbour2 = 0;
365  TH2F* hENeighbour2 = 0;
366  options_->GetOpt("clustering", "HFEM", outputFile2);
367  if(!outputFile2.empty() ) {
368  file2 = TFile::Open(outputFile2.c_str(),"recreate");
369  hBNeighbour2 = new TH2F("BNeighbour2","f_{Neighbours} vs 1/E_{Seed} (HFEM Barrel)",500, 0., 0.02, 400,0.,1.);
370  hENeighbour2 = new TH2F("ENeighbour2","f_{Neighbours} vs 1/E_{Seed} (HFEM Endcap)",500, 0., 0.02, 400,0.,1.);
371  }
372 
373  std::string outputFile3;
374  TFile* file3 = 0;
375  TH2F* hBNeighbour3 = 0;
376  TH2F* hENeighbour3 = 0;
377  options_->GetOpt("clustering", "HFHAD", outputFile3);
378  if(!outputFile3.empty() ) {
379  file3 = TFile::Open(outputFile3.c_str(),"recreate");
380  hBNeighbour3 = new TH2F("BNeighbour3","f_{Neighbours} vs 1/E_{Seed} (HFHAD Barrel)",500, 0., 0.02, 400,0.,1.);
381  hENeighbour3 = new TH2F("ENeighbour3","f_{Neighbours} vs 1/E_{Seed} (HFHAD Endcap)",500, 0., 0.02, 400,0.,1.);
382  }
383 
384  std::string outputFile4;
385  TFile* file4 = 0;
386  TH2F* hBNeighbour4 = 0;
387  TH2F* hENeighbour4 = 0;
388  options_->GetOpt("clustering", "Preshower", outputFile4);
389  if(!outputFile4.empty() ) {
390  file4 = TFile::Open(outputFile4.c_str(),"recreate");
391  hBNeighbour4 = new TH2F("BNeighbour4","f_{Neighbours} vs 1/E_{Seed} (Preshower Barrel)",200, 0., 1000., 400,0.,1.);
392  hENeighbour4 = new TH2F("ENeighbour4","f_{Neighbours} vs 1/E_{Seed} (Preshower Endcap)",200, 0., 1000., 400,0.,1.);
393  }
394 
395  // input root file --------------------------------------------
396 
397  if( reconnect )
398  connect();
399 
400  // filter --------------------------------------------------------------
401 
402  filterNParticles_ = 0;
403  options_->GetOpt("filter", "nparticles", filterNParticles_);
404 
405  filterHadronicTaus_ = true;
406  options_->GetOpt("filter", "hadronic_taus", filterHadronicTaus_);
407 
408  filterTaus_.clear();
409  options_->GetOpt("filter", "taus", filterTaus_);
410  if( !filterTaus_.empty() &&
411  filterTaus_.size() != 2 ) {
412  cerr<<"PFRootEventManager::ReadOptions, bad filter/taus option."<<endl
413  <<"please use : "<<endl
414  <<"\tfilter taus n_charged n_neutral"<<endl;
415  filterTaus_.clear();
416  }
417 
418 
419  // clustering parameters -----------------------------------------------
420 
421  //Rechit for Ring 0 and +-1/2
422  double threshold_R0=0.4;
423  options_->GetOpt("clustering", "threshold_Hit_R0", threshold_R0);
424 
425  double threshold_R1=1.0;
426  options_->GetOpt("clustering", "threshold_Hit_R1", threshold_R1);
427 
428  //Clustering
429  double threshHO_Seed_Ring0=1.0;
430  options_->GetOpt("clustering", "threshHO_Seed_Ring0", threshHO_Seed_Ring0);
431 
432  double threshHO_Ring0=0.5;
433  options_->GetOpt("clustering", "threshHO_Ring0", threshHO_Ring0);
434 
435  double threshHO_Seed_Outer=3.1;
436  options_->GetOpt("clustering", "threshHO_Seed_Outer", threshHO_Seed_Outer);
437 
438  double threshHO_Outer=1.0;
439  options_->GetOpt("clustering", "threshHO_Outer", threshHO_Outer);
440 
441 
442  doClustering_ = true;
443  //options_->GetOpt("clustering", "on/off", doClustering_);
444 
445  bool clusteringDebug = false;
446  options_->GetOpt("clustering", "debug", clusteringDebug );
447 
448  findRecHitNeighbours_ = true;
449  options_->GetOpt("clustering", "findRecHitNeighbours",
451 
452  double threshEcalBarrel = 0.1;
453  options_->GetOpt("clustering", "thresh_Ecal_Barrel", threshEcalBarrel);
454 
455  double threshPtEcalBarrel = 0.0;
456  options_->GetOpt("clustering", "thresh_Pt_Ecal_Barrel", threshPtEcalBarrel);
457 
458  double threshSeedEcalBarrel = 0.3;
459  options_->GetOpt("clustering", "thresh_Seed_Ecal_Barrel",
460  threshSeedEcalBarrel);
461 
462  double threshPtSeedEcalBarrel = 0.0;
463  options_->GetOpt("clustering", "thresh_Pt_Seed_Ecal_Barrel",
464  threshPtSeedEcalBarrel);
465 
466  double threshCleanEcalBarrel = 1E5;
467  options_->GetOpt("clustering", "thresh_Clean_Ecal_Barrel",
468  threshCleanEcalBarrel);
469 
470  std::vector<double> minS4S1CleanEcalBarrel;
471  options_->GetOpt("clustering", "minS4S1_Clean_Ecal_Barrel",
472  minS4S1CleanEcalBarrel);
473 
474  double threshDoubleSpikeEcalBarrel = 10.;
475  options_->GetOpt("clustering", "thresh_DoubleSpike_Ecal_Barrel",
476  threshDoubleSpikeEcalBarrel);
477 
478  double minS6S2DoubleSpikeEcalBarrel = 0.04;
479  options_->GetOpt("clustering", "minS6S2_DoubleSpike_Ecal_Barrel",
480  minS6S2DoubleSpikeEcalBarrel);
481 
482  double threshEcalEndcap = 0.2;
483  options_->GetOpt("clustering", "thresh_Ecal_Endcap", threshEcalEndcap);
484 
485  double threshPtEcalEndcap = 0.0;
486  options_->GetOpt("clustering", "thresh_Pt_Ecal_Endcap", threshPtEcalEndcap);
487 
488  double threshSeedEcalEndcap = 0.8;
489  options_->GetOpt("clustering", "thresh_Seed_Ecal_Endcap",
490  threshSeedEcalEndcap);
491 
492  double threshPtSeedEcalEndcap = 0.0;
493  options_->GetOpt("clustering", "thresh_Pt_Seed_Ecal_Endcap",
494  threshPtSeedEcalEndcap);
495 
496  double threshCleanEcalEndcap = 1E5;
497  options_->GetOpt("clustering", "thresh_Clean_Ecal_Endcap",
498  threshCleanEcalEndcap);
499 
500  std::vector<double> minS4S1CleanEcalEndcap;
501  options_->GetOpt("clustering", "minS4S1_Clean_Ecal_Endcap",
502  minS4S1CleanEcalEndcap);
503 
504  double threshDoubleSpikeEcalEndcap = 1E9;
505  options_->GetOpt("clustering", "thresh_DoubleSpike_Ecal_Endcap",
506  threshDoubleSpikeEcalEndcap);
507 
508  double minS6S2DoubleSpikeEcalEndcap = -1.;
509  options_->GetOpt("clustering", "minS6S2_DoubleSpike_Ecal_Endcap",
510  minS6S2DoubleSpikeEcalEndcap);
511 
512  double showerSigmaEcal = 3;
513  options_->GetOpt("clustering", "shower_Sigma_Ecal",
514  showerSigmaEcal);
515 
516  int nNeighboursEcal = 4;
517  options_->GetOpt("clustering", "neighbours_Ecal", nNeighboursEcal);
518 
519  int posCalcNCrystalEcal = -1;
520  options_->GetOpt("clustering", "posCalc_nCrystal_Ecal",
521  posCalcNCrystalEcal);
522 
523  double posCalcP1Ecal
524  = threshEcalBarrel<threshEcalEndcap ? threshEcalBarrel:threshEcalEndcap;
525 // options_->GetOpt("clustering", "posCalc_p1_Ecal",
526 // posCalcP1Ecal);
527 
528  bool useCornerCellsEcal = false;
529  options_->GetOpt("clustering", "useCornerCells_Ecal",
530  useCornerCellsEcal);
531 
532  clusterAlgoECAL_.setHistos(file0,hBNeighbour0,hENeighbour0);
533 
534  clusterAlgoECAL_.setThreshBarrel( threshEcalBarrel );
535  clusterAlgoECAL_.setThreshSeedBarrel( threshSeedEcalBarrel );
536 
537  clusterAlgoECAL_.setThreshPtBarrel( threshPtEcalBarrel );
538  clusterAlgoECAL_.setThreshPtSeedBarrel( threshPtSeedEcalBarrel );
539 
540  clusterAlgoECAL_.setThreshCleanBarrel(threshCleanEcalBarrel);
541  clusterAlgoECAL_.setS4S1CleanBarrel(minS4S1CleanEcalBarrel);
542 
543  clusterAlgoECAL_.setThreshDoubleSpikeBarrel( threshDoubleSpikeEcalBarrel );
544  clusterAlgoECAL_.setS6S2DoubleSpikeBarrel( minS6S2DoubleSpikeEcalBarrel );
545 
546  clusterAlgoECAL_.setThreshEndcap( threshEcalEndcap );
547  clusterAlgoECAL_.setThreshSeedEndcap( threshSeedEcalEndcap );
548 
549  clusterAlgoECAL_.setThreshPtEndcap( threshPtEcalEndcap );
550  clusterAlgoECAL_.setThreshPtSeedEndcap( threshPtSeedEcalEndcap );
551 
552  clusterAlgoECAL_.setThreshCleanEndcap(threshCleanEcalEndcap);
553  clusterAlgoECAL_.setS4S1CleanEndcap(minS4S1CleanEcalEndcap);
554 
555  clusterAlgoECAL_.setThreshDoubleSpikeEndcap( threshDoubleSpikeEcalEndcap );
556  clusterAlgoECAL_.setS6S2DoubleSpikeEndcap( minS6S2DoubleSpikeEcalEndcap );
557 
558  clusterAlgoECAL_.setNNeighbours( nNeighboursEcal );
559  clusterAlgoECAL_.setShowerSigma( showerSigmaEcal );
560 
561  clusterAlgoECAL_.setPosCalcNCrystal( posCalcNCrystalEcal );
562  clusterAlgoECAL_.setPosCalcP1( posCalcP1Ecal );
563 
564  clusterAlgoECAL_.setUseCornerCells( useCornerCellsEcal );
565 
566  clusterAlgoECAL_.enableDebugging( clusteringDebug );
567 
568  int dcormode = 0;
569  options_->GetOpt("clustering", "depthCor_Mode", dcormode);
570 
571  double dcora = -1;
572  options_->GetOpt("clustering", "depthCor_A", dcora);
573  double dcorb = -1;
574  options_->GetOpt("clustering", "depthCor_B", dcorb);
575  double dcorap = -1;
576  options_->GetOpt("clustering", "depthCor_A_preshower", dcorap);
577  double dcorbp = -1;
578  options_->GetOpt("clustering", "depthCor_B_preshower", dcorbp);
579 
580  // if( dcormode > 0 &&
581  // dcora > -0.5 &&
582  // dcorb > -0.5 &&
583  // dcorap > -0.5 &&
584  // dcorbp > -0.5 ) {
585 
586  // cout<<"set depth correction "
587  // <<dcormode<<" "<<dcora<<" "<<dcorb<<" "<<dcorap<<" "<<dcorbp<<endl;
589  dcora, dcorb,
590  dcorap, dcorbp);
591  // }
592  // else {
593  // reco::PFCluster::setDepthCorParameters( -1,
594  // 0,0 ,
595  // 0,0 );
596  // }
597 
598 
599  // And now the HCAL
600  double threshHcalBarrel = 0.8;
601  options_->GetOpt("clustering", "thresh_Hcal_Barrel", threshHcalBarrel);
602 
603  double threshPtHcalBarrel = 0.0;
604  options_->GetOpt("clustering", "thresh_Pt_Hcal_Barrel", threshPtHcalBarrel);
605 
606  double threshSeedHcalBarrel = 1.4;
607  options_->GetOpt("clustering", "thresh_Seed_Hcal_Barrel",
608  threshSeedHcalBarrel);
609 
610  double threshPtSeedHcalBarrel = 0.0;
611  options_->GetOpt("clustering", "thresh_Pt_Seed_Hcal_Barrel",
612  threshPtSeedHcalBarrel);
613 
614  double threshCleanHcalBarrel = 1E5;
615  options_->GetOpt("clustering", "thresh_Clean_Hcal_Barrel",
616  threshCleanHcalBarrel);
617 
618  std::vector<double> minS4S1CleanHcalBarrel;
619  options_->GetOpt("clustering", "minS4S1_Clean_Hcal_Barrel",
620  minS4S1CleanHcalBarrel);
621 
622  double threshHcalEndcap = 0.8;
623  options_->GetOpt("clustering", "thresh_Hcal_Endcap", threshHcalEndcap);
624 
625  double threshPtHcalEndcap = 0.0;
626  options_->GetOpt("clustering", "thresh_Pt_Hcal_Endcap", threshPtHcalEndcap);
627 
628  double threshSeedHcalEndcap = 1.4;
629  options_->GetOpt("clustering", "thresh_Seed_Hcal_Endcap",
630  threshSeedHcalEndcap);
631 
632  double threshPtSeedHcalEndcap = 0.0;
633  options_->GetOpt("clustering", "thresh_Pt_Seed_Hcal_Endcap",
634  threshPtSeedHcalEndcap);
635 
636  double threshCleanHcalEndcap = 1E5;
637  options_->GetOpt("clustering", "thresh_Clean_Hcal_Endcap",
638  threshCleanHcalEndcap);
639 
640  std::vector<double> minS4S1CleanHcalEndcap;
641  options_->GetOpt("clustering", "minS4S1_Clean_Hcal_Endcap",
642  minS4S1CleanHcalEndcap);
643 
644  double showerSigmaHcal = 15;
645  options_->GetOpt("clustering", "shower_Sigma_Hcal",
646  showerSigmaHcal);
647 
648  int nNeighboursHcal = 4;
649  options_->GetOpt("clustering", "neighbours_Hcal", nNeighboursHcal);
650 
651  int posCalcNCrystalHcal = 5;
652  options_->GetOpt("clustering", "posCalc_nCrystal_Hcal",
653  posCalcNCrystalHcal);
654 
655  bool useCornerCellsHcal = false;
656  options_->GetOpt("clustering", "useCornerCells_Hcal",
657  useCornerCellsHcal);
658 
659  bool cleanRBXandHPDs = false;
660  options_->GetOpt("clustering", "cleanRBXandHPDs_Hcal",
661  cleanRBXandHPDs);
662 
663  double posCalcP1Hcal
664  = threshHcalBarrel<threshHcalEndcap ? threshHcalBarrel:threshHcalEndcap;
665 // options_->GetOpt("clustering", "posCalc_p1_Hcal",
666 // posCalcP1Hcal);
667 
668 
669  clusterAlgoHCAL_.setHistos(file1,hBNeighbour1,hENeighbour1);
670 
671 
672  clusterAlgoHCAL_.setThreshBarrel( threshHcalBarrel );
673  clusterAlgoHCAL_.setThreshSeedBarrel( threshSeedHcalBarrel );
674 
675  clusterAlgoHCAL_.setThreshPtBarrel( threshPtHcalBarrel );
676  clusterAlgoHCAL_.setThreshPtSeedBarrel( threshPtSeedHcalBarrel );
677 
678  clusterAlgoHCAL_.setThreshCleanBarrel(threshCleanHcalBarrel);
679  clusterAlgoHCAL_.setS4S1CleanBarrel(minS4S1CleanHcalBarrel);
680 
681  clusterAlgoHCAL_.setThreshEndcap( threshHcalEndcap );
682  clusterAlgoHCAL_.setThreshSeedEndcap( threshSeedHcalEndcap );
683 
684  clusterAlgoHCAL_.setThreshPtEndcap( threshPtHcalEndcap );
685  clusterAlgoHCAL_.setThreshPtSeedEndcap( threshPtSeedHcalEndcap );
686 
687  clusterAlgoHCAL_.setThreshCleanEndcap(threshCleanHcalEndcap);
688  clusterAlgoHCAL_.setS4S1CleanEndcap(minS4S1CleanHcalEndcap);
689 
690  clusterAlgoHCAL_.setNNeighbours( nNeighboursHcal );
691  clusterAlgoHCAL_.setShowerSigma( showerSigmaHcal );
692 
693  clusterAlgoHCAL_.setPosCalcNCrystal( posCalcNCrystalHcal );
694  clusterAlgoHCAL_.setPosCalcP1( posCalcP1Hcal );
695 
696  clusterAlgoHCAL_.setUseCornerCells( useCornerCellsHcal );
697  clusterAlgoHCAL_.setCleanRBXandHPDs( cleanRBXandHPDs );
698 
699  clusterAlgoHCAL_.enableDebugging( clusteringDebug );
700 
701 
702  // And now the HO
703  double threshHOBarrel = 0.5;
704  options_->GetOpt("clustering", "thresh_HO_Barrel", threshHOBarrel);
705 
706  double threshPtHOBarrel = 0.0;
707  options_->GetOpt("clustering", "thresh_Pt_HO_Barrel", threshPtHOBarrel);
708 
709  double threshSeedHOBarrel = 1.0;
710  options_->GetOpt("clustering", "thresh_Seed_HO_Barrel",
711  threshSeedHOBarrel);
712 
713  double threshPtSeedHOBarrel = 0.0;
714  options_->GetOpt("clustering", "thresh_Pt_Seed_HO_Barrel",
715  threshPtSeedHOBarrel);
716 
717  double threshCleanHOBarrel = 1E5;
718  options_->GetOpt("clustering", "thresh_Clean_HO_Barrel",
719  threshCleanHOBarrel);
720 
721  std::vector<double> minS4S1CleanHOBarrel;
722  options_->GetOpt("clustering", "minS4S1_Clean_HO_Barrel",
723  minS4S1CleanHOBarrel);
724 
725  double threshDoubleSpikeHOBarrel = 1E9;
726  options_->GetOpt("clustering", "thresh_DoubleSpike_HO_Barrel",
727  threshDoubleSpikeHOBarrel);
728 
729  double minS6S2DoubleSpikeHOBarrel = -1;
730  options_->GetOpt("clustering", "minS6S2_DoubleSpike_HO_Barrel",
731  minS6S2DoubleSpikeHOBarrel);
732 
733  double threshHOEndcap = 1.0;
734  options_->GetOpt("clustering", "thresh_HO_Endcap", threshHOEndcap);
735 
736  double threshPtHOEndcap = 0.0;
737  options_->GetOpt("clustering", "thresh_Pt_HO_Endcap", threshPtHOEndcap);
738 
739  double threshSeedHOEndcap = 3.1;
740  options_->GetOpt("clustering", "thresh_Seed_HO_Endcap",
741  threshSeedHOEndcap);
742 
743  double threshPtSeedHOEndcap = 0.0;
744  options_->GetOpt("clustering", "thresh_Pt_Seed_HO_Endcap",
745  threshPtSeedHOEndcap);
746 
747  double threshCleanHOEndcap = 1E5;
748  options_->GetOpt("clustering", "thresh_Clean_HO_Endcap",
749  threshCleanHOEndcap);
750 
751  std::vector<double> minS4S1CleanHOEndcap;
752  options_->GetOpt("clustering", "minS4S1_Clean_HO_Endcap",
753  minS4S1CleanHOEndcap);
754 
755  double threshDoubleSpikeHOEndcap = 1E9;
756  options_->GetOpt("clustering", "thresh_DoubleSpike_HO_Endcap",
757  threshDoubleSpikeHOEndcap);
758 
759  double minS6S2DoubleSpikeHOEndcap = -1;
760  options_->GetOpt("clustering", "minS6S2_DoubleSpike_HO_Endcap",
761  minS6S2DoubleSpikeHOEndcap);
762 
763  double showerSigmaHO = 15;
764  options_->GetOpt("clustering", "shower_Sigma_HO",
765  showerSigmaHO);
766 
767  int nNeighboursHO = 4;
768  options_->GetOpt("clustering", "neighbours_HO", nNeighboursHO);
769 
770  int posCalcNCrystalHO = 5;
771  options_->GetOpt("clustering", "posCalc_nCrystal_HO",
772  posCalcNCrystalHO);
773 
774  bool useCornerCellsHO = false;
775  options_->GetOpt("clustering", "useCornerCells_HO",
776  useCornerCellsHO);
777 
778  bool cleanRBXandHPDsHO = false;
779  options_->GetOpt("clustering", "cleanRBXandHPDs_HO",
780  cleanRBXandHPDsHO);
781 
782  double posCalcP1HO
783  = threshHOBarrel<threshHOEndcap ? threshHOBarrel:threshHOEndcap;
784 // options_->GetOpt("clustering", "posCalc_p1_HO",
785 // posCalcP1HO);
786 
787 
788  clusterAlgoHO_.setHistos(file1,hBNeighbour1,hENeighbour1);
789 
790 
791  clusterAlgoHO_.setThreshBarrel( threshHOBarrel );
792  clusterAlgoHO_.setThreshSeedBarrel( threshSeedHOBarrel );
793 
794  clusterAlgoHO_.setThreshPtBarrel( threshPtHOBarrel );
795  clusterAlgoHO_.setThreshPtSeedBarrel( threshPtSeedHOBarrel );
796 
797  clusterAlgoHO_.setThreshCleanBarrel(threshCleanHOBarrel);
798  clusterAlgoHO_.setS4S1CleanBarrel(minS4S1CleanHOBarrel);
799 
800  clusterAlgoHO_.setThreshDoubleSpikeBarrel( threshDoubleSpikeHOBarrel );
801  clusterAlgoHO_.setS6S2DoubleSpikeBarrel( minS6S2DoubleSpikeHOBarrel );
802 
803  clusterAlgoHO_.setThreshEndcap( threshHOEndcap );
804  clusterAlgoHO_.setThreshSeedEndcap( threshSeedHOEndcap );
805 
806  clusterAlgoHO_.setThreshPtEndcap( threshPtHOEndcap );
807  clusterAlgoHO_.setThreshPtSeedEndcap( threshPtSeedHOEndcap );
808 
809  clusterAlgoHO_.setThreshCleanEndcap(threshCleanHOEndcap);
810  clusterAlgoHO_.setS4S1CleanEndcap(minS4S1CleanHOEndcap);
811 
812  clusterAlgoHO_.setThreshDoubleSpikeEndcap( threshDoubleSpikeHOEndcap );
813  clusterAlgoHO_.setS6S2DoubleSpikeEndcap( minS6S2DoubleSpikeHOEndcap );
814 
815  clusterAlgoHO_.setNNeighbours( nNeighboursHO );
816  clusterAlgoHO_.setShowerSigma( showerSigmaHO );
817 
818  clusterAlgoHO_.setPosCalcNCrystal( posCalcNCrystalHO );
819  clusterAlgoHO_.setPosCalcP1( posCalcP1HO );
820 
821  clusterAlgoHO_.setUseCornerCells( useCornerCellsHO );
822  clusterAlgoHO_.setCleanRBXandHPDs( cleanRBXandHPDs );
823 
824  clusterAlgoHO_.enableDebugging( clusteringDebug );
825 
826 
827  // clustering HF EM
828 
829  double threshHFEM = 0.;
830  options_->GetOpt("clustering", "thresh_HFEM", threshHFEM);
831 
832  double threshPtHFEM = 0.;
833  options_->GetOpt("clustering", "thresh_Pt_HFEM", threshPtHFEM);
834 
835  double threshSeedHFEM = 0.001;
836  options_->GetOpt("clustering", "thresh_Seed_HFEM",
837  threshSeedHFEM);
838 
839  double threshPtSeedHFEM = 0.0;
840  options_->GetOpt("clustering", "thresh_Pt_Seed_HFEM",
841  threshPtSeedHFEM);
842 
843  double threshCleanHFEM = 1E5;
844  options_->GetOpt("clustering", "thresh_Clean_HFEM",
845  threshCleanHFEM);
846 
847  std::vector<double> minS4S1CleanHFEM;
848  options_->GetOpt("clustering", "minS4S1_Clean_HFEM",
849  minS4S1CleanHFEM);
850 
851  double showerSigmaHFEM = 0.1;
852  options_->GetOpt("clustering", "shower_Sigma_HFEM",
853  showerSigmaHFEM);
854 
855  int nNeighboursHFEM = 4;
856  options_->GetOpt("clustering", "neighbours_HFEM", nNeighboursHFEM);
857 
858  int posCalcNCrystalHFEM = -1;
859  options_->GetOpt("clustering", "posCalc_nCrystal_HFEM",
860  posCalcNCrystalHFEM);
861 
862  bool useCornerCellsHFEM = false;
863  options_->GetOpt("clustering", "useCornerCells_HFEM",
864  useCornerCellsHFEM);
865 
866  double posCalcP1HFEM = threshHFEM;
867 // options_->GetOpt("clustering", "posCalc_p1_HFEM",
868 // posCalcP1HFEM);
869 
870 
871  clusterAlgoHFEM_.setHistos(file2,hBNeighbour2,hENeighbour2);
872 
873  clusterAlgoHFEM_.setThreshEndcap( threshHFEM );
874  clusterAlgoHFEM_.setThreshSeedEndcap( threshSeedHFEM );
875 
876  clusterAlgoHFEM_.setThreshPtEndcap( threshPtHFEM );
877  clusterAlgoHFEM_.setThreshPtSeedEndcap( threshPtSeedHFEM );
878 
879  clusterAlgoHFEM_.setThreshCleanEndcap(threshCleanHFEM);
880  clusterAlgoHFEM_.setS4S1CleanEndcap(minS4S1CleanHFEM);
881 
882  clusterAlgoHFEM_.setNNeighbours( nNeighboursHFEM );
883  clusterAlgoHFEM_.setShowerSigma( showerSigmaHFEM );
884 
885  clusterAlgoHFEM_.setPosCalcNCrystal( posCalcNCrystalHFEM );
886  clusterAlgoHFEM_.setPosCalcP1( posCalcP1HFEM );
887 
888  clusterAlgoHFEM_.setUseCornerCells( useCornerCellsHFEM );
889 
890  clusterAlgoHFEM_.enableDebugging( clusteringDebug );
891 
892  // clustering HFHAD
893 
894  double threshHFHAD = 0.;
895  options_->GetOpt("clustering", "thresh_HFHAD", threshHFHAD);
896 
897  double threshPtHFHAD = 0.;
898  options_->GetOpt("clustering", "thresh_Pt_HFHAD", threshPtHFHAD);
899 
900  double threshSeedHFHAD = 0.001;
901  options_->GetOpt("clustering", "thresh_Seed_HFHAD",
902  threshSeedHFHAD);
903 
904  double threshPtSeedHFHAD = 0.0;
905  options_->GetOpt("clustering", "thresh_Pt_Seed_HFHAD",
906  threshPtSeedHFHAD);
907 
908  double threshCleanHFHAD = 1E5;
909  options_->GetOpt("clustering", "thresh_Clean_HFHAD",
910  threshCleanHFHAD);
911 
912  std::vector<double> minS4S1CleanHFHAD;
913  options_->GetOpt("clustering", "minS4S1_Clean_HFHAD",
914  minS4S1CleanHFHAD);
915 
916  double showerSigmaHFHAD = 0.1;
917  options_->GetOpt("clustering", "shower_Sigma_HFHAD",
918  showerSigmaHFHAD);
919 
920  int nNeighboursHFHAD = 4;
921  options_->GetOpt("clustering", "neighbours_HFHAD", nNeighboursHFHAD);
922 
923  int posCalcNCrystalHFHAD = -1;
924  options_->GetOpt("clustering", "posCalc_nCrystal_HFHAD",
925  posCalcNCrystalHFHAD);
926 
927  bool useCornerCellsHFHAD = false;
928  options_->GetOpt("clustering", "useCornerCells_HFHAD",
929  useCornerCellsHFHAD);
930 
931  double posCalcP1HFHAD = threshHFHAD;
932 // options_->GetOpt("clustering", "posCalc_p1_HFHAD",
933 // posCalcP1HFHAD);
934 
935 
936  clusterAlgoHFHAD_.setHistos(file3,hBNeighbour3,hENeighbour3);
937 
938  clusterAlgoHFHAD_.setThreshEndcap( threshHFHAD );
939  clusterAlgoHFHAD_.setThreshSeedEndcap( threshSeedHFHAD );
940 
941  clusterAlgoHFHAD_.setThreshPtEndcap( threshPtHFHAD );
942  clusterAlgoHFHAD_.setThreshPtSeedEndcap( threshPtSeedHFHAD );
943 
944  clusterAlgoHFHAD_.setThreshCleanEndcap(threshCleanHFHAD);
945  clusterAlgoHFHAD_.setS4S1CleanEndcap(minS4S1CleanHFHAD);
946 
947  clusterAlgoHFHAD_.setNNeighbours( nNeighboursHFHAD );
948  clusterAlgoHFHAD_.setShowerSigma( showerSigmaHFHAD );
949 
950  clusterAlgoHFHAD_.setPosCalcNCrystal( posCalcNCrystalHFHAD );
951  clusterAlgoHFHAD_.setPosCalcP1( posCalcP1HFHAD );
952 
953  clusterAlgoHFHAD_.setUseCornerCells( useCornerCellsHFHAD );
954 
955  clusterAlgoHFHAD_.enableDebugging( clusteringDebug );
956 
957  // clustering preshower
958 
959  double threshPS = 0.0001;
960  options_->GetOpt("clustering", "thresh_PS", threshPS);
961 
962  double threshPtPS = 0.0;
963  options_->GetOpt("clustering", "thresh_Pt_PS", threshPtPS);
964 
965  double threshSeedPS = 0.001;
966  options_->GetOpt("clustering", "thresh_Seed_PS",
967  threshSeedPS);
968 
969  double threshPtSeedPS = 0.0;
970  options_->GetOpt("clustering", "thresh_Pt_Seed_PS", threshPtSeedPS);
971 
972  double threshCleanPS = 1E5;
973  options_->GetOpt("clustering", "thresh_Clean_PS", threshCleanPS);
974 
975  std::vector<double> minS4S1CleanPS;
976  options_->GetOpt("clustering", "minS4S1_Clean_PS", minS4S1CleanPS);
977 
978  //Comment Michel: PSBarrel shall be removed?
979  double threshPSBarrel = threshPS;
980  double threshSeedPSBarrel = threshSeedPS;
981 
982  double threshPtPSBarrel = threshPtPS;
983  double threshPtSeedPSBarrel = threshPtSeedPS;
984 
985  double threshCleanPSBarrel = threshCleanPS;
986  std::vector<double> minS4S1CleanPSBarrel = minS4S1CleanPS;
987 
988  double threshPSEndcap = threshPS;
989  double threshSeedPSEndcap = threshSeedPS;
990 
991  double threshPtPSEndcap = threshPtPS;
992  double threshPtSeedPSEndcap = threshPtSeedPS;
993 
994  double threshCleanPSEndcap = threshCleanPS;
995  std::vector<double> minS4S1CleanPSEndcap = minS4S1CleanPS;
996 
997  double showerSigmaPS = 0.1;
998  options_->GetOpt("clustering", "shower_Sigma_PS",
999  showerSigmaPS);
1000 
1001  int nNeighboursPS = 4;
1002  options_->GetOpt("clustering", "neighbours_PS", nNeighboursPS);
1003 
1004  int posCalcNCrystalPS = -1;
1005  options_->GetOpt("clustering", "posCalc_nCrystal_PS",
1006  posCalcNCrystalPS);
1007 
1008  bool useCornerCellsPS = false;
1009  options_->GetOpt("clustering", "useCornerCells_PS",
1010  useCornerCellsPS);
1011 
1012  double posCalcP1PS = threshPS;
1013 // options_->GetOpt("clustering", "posCalc_p1_PS",
1014 // posCalcP1PS);
1015 
1016 
1017  clusterAlgoPS_.setHistos(file4,hBNeighbour4,hENeighbour4);
1018 
1019 
1020 
1021  clusterAlgoPS_.setThreshBarrel( threshPSBarrel );
1022  clusterAlgoPS_.setThreshSeedBarrel( threshSeedPSBarrel );
1023 
1024  clusterAlgoPS_.setThreshPtBarrel( threshPtPSBarrel );
1025  clusterAlgoPS_.setThreshPtSeedBarrel( threshPtSeedPSBarrel );
1026 
1027  clusterAlgoPS_.setThreshCleanBarrel(threshCleanPSBarrel);
1028  clusterAlgoPS_.setS4S1CleanBarrel(minS4S1CleanPSBarrel);
1029 
1030  clusterAlgoPS_.setThreshEndcap( threshPSEndcap );
1031  clusterAlgoPS_.setThreshSeedEndcap( threshSeedPSEndcap );
1032 
1033  clusterAlgoPS_.setThreshPtEndcap( threshPtPSEndcap );
1034  clusterAlgoPS_.setThreshPtSeedEndcap( threshPtSeedPSEndcap );
1035 
1036  clusterAlgoPS_.setThreshCleanEndcap(threshCleanPSEndcap);
1037  clusterAlgoPS_.setS4S1CleanEndcap(minS4S1CleanPSEndcap);
1038 
1039  clusterAlgoPS_.setNNeighbours( nNeighboursPS );
1040  clusterAlgoPS_.setShowerSigma( showerSigmaPS );
1041 
1042  clusterAlgoPS_.setPosCalcNCrystal( posCalcNCrystalPS );
1043  clusterAlgoPS_.setPosCalcP1( posCalcP1PS );
1044 
1045  clusterAlgoPS_.setUseCornerCells( useCornerCellsPS );
1046 
1047  clusterAlgoPS_.enableDebugging( clusteringDebug );
1048 
1049  // options for particle flow ---------------------------------------------
1050 
1051 
1052  doParticleFlow_ = true;
1053  doCompare_ = false;
1054  options_->GetOpt("particle_flow", "on/off", doParticleFlow_);
1055  options_->GetOpt("particle_flow", "comparison", doCompare_);
1056 
1058  options_->GetOpt("particle_flow", "useKDTreeTrackEcalLinker", useKDTreeTrackEcalLinker_);
1059  std::cout << "Use Track-ECAL link optimization: " << useKDTreeTrackEcalLinker_ << std::endl;
1061 
1062  std::vector<double> DPtovPtCut;
1063  std::vector<unsigned> NHitCut;
1064  bool useIterTracking;
1065  int nuclearInteractionsPurity;
1066  options_->GetOpt("particle_flow", "DPtoverPt_Cut", DPtovPtCut);
1067  options_->GetOpt("particle_flow", "NHit_Cut", NHitCut);
1068  options_->GetOpt("particle_flow", "useIterTracking", useIterTracking);
1069  options_->GetOpt("particle_flow", "nuclearInteractionsPurity", nuclearInteractionsPurity);
1070 
1071 
1072  std::vector<double> PhotonSelectionCuts;
1073  options_->GetOpt("particle_flow","useEGPhotons",useEGPhotons_);
1074  options_->GetOpt("particle_flow","photonSelection", PhotonSelectionCuts);
1075 
1076  try {
1077  pfBlockAlgo_.setParameters( DPtovPtCut,
1078  NHitCut,
1079  useIterTracking,
1081  nuclearInteractionsPurity,
1082  useEGPhotons_,
1083  PhotonSelectionCuts,
1084  false
1085  );
1086  }
1087  catch( std::exception& err ) {
1088  cerr<<"exception setting PFBlockAlgo parameters: "
1089  <<err.what()<<". terminating."<<endl;
1090  delete this;
1091  exit(1);
1092  }
1093 
1094 
1095  bool blockAlgoDebug = false;
1096  options_->GetOpt("blockAlgo", "debug", blockAlgoDebug);
1097  pfBlockAlgo_.setDebug( blockAlgoDebug );
1098 
1099  bool AlgoDebug = false;
1100  options_->GetOpt("PFAlgo", "debug", AlgoDebug);
1101  pfAlgo_.setDebug( AlgoDebug );
1102 
1103  // read PFCluster calibration parameters
1104  boost::shared_ptr<PFEnergyCalibration>
1105  calibration( new PFEnergyCalibration() );
1106  calibration_ = calibration;
1107 
1108  bool usePFSCEleCalib;
1109  std::vector<double> calibPFSCEle_Fbrem_barrel;
1110  std::vector<double> calibPFSCEle_Fbrem_endcap;
1111  std::vector<double> calibPFSCEle_barrel;
1112  std::vector<double> calibPFSCEle_endcap;
1113  options_->GetOpt("particle_flow","usePFSCEleCalib",usePFSCEleCalib);
1114  options_->GetOpt("particle_flow","calibPFSCEle_Fbrem_barrel",calibPFSCEle_Fbrem_barrel);
1115  options_->GetOpt("particle_flow","calibPFSCEle_Fbrem_endcap",calibPFSCEle_Fbrem_endcap);
1116  options_->GetOpt("particle_flow","calibPFSCEle_barrel",calibPFSCEle_barrel);
1117  options_->GetOpt("particle_flow","calibPFSCEle_endcap",calibPFSCEle_endcap);
1118  boost::shared_ptr<PFSCEnergyCalibration>
1119  thePFSCEnergyCalibration (new PFSCEnergyCalibration(calibPFSCEle_Fbrem_barrel,calibPFSCEle_Fbrem_endcap,
1120  calibPFSCEle_barrel,calibPFSCEle_endcap ));
1121 
1122  bool useEGammaSupercluster;
1123  double sumEtEcalIsoForEgammaSC_barrel;
1124  double sumEtEcalIsoForEgammaSC_endcap;
1125  double coneEcalIsoForEgammaSC;
1126  double sumPtTrackIsoForEgammaSC_barrel;
1127  double sumPtTrackIsoForEgammaSC_endcap;
1128  unsigned int nTrackIsoForEgammaSC;
1129  double coneTrackIsoForEgammaSC;
1130  options_->GetOpt("particle_flow","useEGammaSupercluster",useEGammaSupercluster);
1131  options_->GetOpt("particle_flow","sumEtEcalIsoForEgammaSC_barrel",sumEtEcalIsoForEgammaSC_barrel);
1132  options_->GetOpt("particle_flow","sumEtEcalIsoForEgammaSC_endcap",sumEtEcalIsoForEgammaSC_endcap);
1133  options_->GetOpt("particle_flow","coneEcalIsoForEgammaSC",coneEcalIsoForEgammaSC);
1134  options_->GetOpt("particle_flow","sumPtTrackIsoForEgammaSC_barrel",sumPtTrackIsoForEgammaSC_barrel);
1135  options_->GetOpt("particle_flow","sumPtTrackIsoForEgammaSC_endcap",sumPtTrackIsoForEgammaSC_endcap);
1136  options_->GetOpt("particle_flow","nTrackIsoForEgammaSC",nTrackIsoForEgammaSC);
1137  options_->GetOpt("particle_flow","coneTrackIsoForEgammaSC",coneTrackIsoForEgammaSC);
1138  options_->GetOpt("particle_flow","useEGammaElectrons",useEGElectrons_);
1139 
1140  //--ab: get calibration factors for HF:
1141  bool calibHF_use = false;
1142  std::vector<double> calibHF_eta_step;
1143  std::vector<double> calibHF_a_EMonly;
1144  std::vector<double> calibHF_b_HADonly;
1145  std::vector<double> calibHF_a_EMHAD;
1146  std::vector<double> calibHF_b_EMHAD;
1147 
1148  options_->GetOpt("particle_flow","calib_calibHF_use",calibHF_use);
1149  options_->GetOpt("particle_flow","calib_calibHF_eta_step",calibHF_eta_step);
1150  options_->GetOpt("particle_flow","calib_calibHF_a_EMonly",calibHF_a_EMonly);
1151  options_->GetOpt("particle_flow","calib_calibHF_b_HADonly",calibHF_b_HADonly);
1152  options_->GetOpt("particle_flow","calib_calibHF_a_EMHAD",calibHF_a_EMHAD);
1153  options_->GetOpt("particle_flow","calib_calibHF_b_EMHAD",calibHF_b_EMHAD);
1154 
1155  boost::shared_ptr<PFEnergyCalibrationHF> thepfEnergyCalibrationHF
1156  ( new PFEnergyCalibrationHF(calibHF_use,calibHF_eta_step,calibHF_a_EMonly,calibHF_b_HADonly,calibHF_a_EMHAD,calibHF_b_EMHAD) ) ;
1157 
1158  thepfEnergyCalibrationHF_ = thepfEnergyCalibrationHF;
1159 
1160 
1161  //----------------------------------------
1162  double nSigmaECAL = 99999;
1163  options_->GetOpt("particle_flow", "nsigma_ECAL", nSigmaECAL);
1164  double nSigmaHCAL = 99999;
1165  options_->GetOpt("particle_flow", "nsigma_HCAL", nSigmaHCAL);
1166 
1167  try {
1168  pfAlgo_.setParameters( nSigmaECAL, nSigmaHCAL,
1169  calibration, thepfEnergyCalibrationHF_);
1170  }
1171  catch( std::exception& err ) {
1172  cerr<<"exception setting PFAlgo parameters: "
1173  <<err.what()<<". terminating."<<endl;
1174  delete this;
1175  exit(1);
1176  }
1177 
1178  std::vector<double> muonHCAL;
1179  std::vector<double> muonECAL;
1180  std::vector<double> muonHO;
1181  options_->GetOpt("particle_flow", "muon_HCAL", muonHCAL);
1182  options_->GetOpt("particle_flow", "muon_ECAL", muonECAL);
1183  options_->GetOpt("particle_flow", "muon_HO", muonHO);
1184 
1185  assert ( muonHCAL.size() == 2 && muonECAL.size() == 2 && muonHO.size() == 2);
1186 
1187  double nSigmaTRACK = 3.0;
1188  options_->GetOpt("particle_flow", "nsigma_TRACK", nSigmaTRACK);
1189 
1190  double ptError = 1.0;
1191  options_->GetOpt("particle_flow", "pt_error", ptError);
1192 
1193  std::vector<double> factors45;
1194  options_->GetOpt("particle_flow", "factors_45", factors45);
1195  assert ( factors45.size() == 2 );
1196 
1197  edm::ParameterSet iConfig;
1198 
1199 
1200  double maxDPtOPt;
1201  options_->GetOpt("particle_flow", "maxDPtOPt", maxDPtOPt);
1202  iConfig.addParameter<double>("maxDPtOPt",maxDPtOPt);
1203 
1204  int minTrackerHits;
1205  options_->GetOpt("particle_flow", "minTrackerHits", minTrackerHits);
1206  iConfig.addParameter<int>("minTrackerHits",minTrackerHits);
1207 
1208  int minPixelHits;
1209  options_->GetOpt("particle_flow", "minPixelHits", minPixelHits);
1210  iConfig.addParameter<int>("minPixelHits",minPixelHits);
1211 
1213  options_->GetOpt("particle_flow", "trackQuality", trackQuality);
1214  iConfig.addParameter<std::string>("trackQuality",trackQuality);
1215 
1216  double ptErrorScale;
1217  options_->GetOpt("particle_flow", "ptErrorScale", ptErrorScale);
1218  iConfig.addParameter<double>("ptErrorScale",ptErrorScale);
1219 
1220  double eventFractionForCleaning;
1221  options_->GetOpt("particle_flow", "eventFractionForCleaning", eventFractionForCleaning);
1222  iConfig.addParameter<double>("eventFractionForCleaning",eventFractionForCleaning);
1223 
1224  double dzpv;
1225  options_->GetOpt("particle_flow", "dzPV", dzpv);
1226  iConfig.addParameter<double>("dzPV",dzpv);
1227 
1228  bool postMuonCleaning;
1229  options_->GetOpt("particle_flow", "postMuonCleaning", postMuonCleaning);
1230  iConfig.addParameter<bool>("postMuonCleaning",postMuonCleaning);
1231 
1232  double minPtForPostCleaning;
1233  options_->GetOpt("particle_flow", "minPtForPostCleaning", minPtForPostCleaning);
1234  iConfig.addParameter<double>("minPtForPostCleaning",minPtForPostCleaning);
1235 
1236  double eventFactorForCosmics;
1237  options_->GetOpt("particle_flow", "eventFactorForCosmics", eventFactorForCosmics);
1238  iConfig.addParameter<double>("eventFactorForCosmics",eventFactorForCosmics);
1239 
1240  double minSignificanceForCleaning;
1241  options_->GetOpt("particle_flow", "metSignificanceForCleaning", minSignificanceForCleaning);
1242  iConfig.addParameter<double>("metSignificanceForCleaning",minSignificanceForCleaning);
1243 
1244  double minSignificanceForRejection;
1245  options_->GetOpt("particle_flow", "metSignificanceForRejection", minSignificanceForRejection);
1246  iConfig.addParameter<double>("metSignificanceForRejection",minSignificanceForRejection);
1247 
1248  double metFactorForCleaning;
1249  options_->GetOpt("particle_flow", "metFactorForCleaning", metFactorForCleaning);
1250  iConfig.addParameter<double>("metFactorForCleaning",metFactorForCleaning);
1251 
1252  double eventFractionForRejection;
1253  options_->GetOpt("particle_flow", "eventFractionForRejection", eventFractionForRejection);
1254  iConfig.addParameter<double>("eventFractionForRejection",eventFractionForRejection);
1255 
1256  double metFactorForRejection;
1257  options_->GetOpt("particle_flow", "metFactorForRejection", metFactorForRejection);
1258  iConfig.addParameter<double>("metFactorForRejection",metFactorForRejection);
1259 
1260  double metFactorForHighEta;
1261  options_->GetOpt("particle_flow", "metFactorForHighEta", metFactorForHighEta);
1262  iConfig.addParameter<double>("metFactorForHighEta",metFactorForHighEta);
1263 
1264  double ptFactorForHighEta;
1265  options_->GetOpt("particle_flow", "ptFactorForHighEta", ptFactorForHighEta);
1266  iConfig.addParameter<double>("ptFactorForHighEta",ptFactorForHighEta);
1267 
1268 
1269  double metFactorForFakes;
1270  options_->GetOpt("particle_flow", "metFactorForFakes", metFactorForFakes);
1271  iConfig.addParameter<double>("metFactorForFakes",metFactorForFakes);
1272 
1273  double minMomentumForPunchThrough;
1274  options_->GetOpt("particle_flow", "minMomentumForPunchThrough", minMomentumForPunchThrough);
1275  iConfig.addParameter<double>("minMomentumForPunchThrough",minMomentumForPunchThrough);
1276 
1277  double minEnergyForPunchThrough;
1278  options_->GetOpt("particle_flow", "minEnergyForPunchThrough", minEnergyForPunchThrough);
1279  iConfig.addParameter<double>("minEnergyForPunchThrough",minEnergyForPunchThrough);
1280 
1281 
1282  double punchThroughFactor;
1283  options_->GetOpt("particle_flow", "punchThroughFactor", punchThroughFactor);
1284  iConfig.addParameter<double>("punchThroughFactor",punchThroughFactor);
1285 
1286  double punchThroughMETFactor;
1287  options_->GetOpt("particle_flow", "punchThroughMETFactor", punchThroughMETFactor);
1288  iConfig.addParameter<double>("punchThroughMETFactor",punchThroughMETFactor);
1289 
1290 
1291  double cosmicRejectionDistance;
1292  options_->GetOpt("particle_flow", "cosmicRejectionDistance", cosmicRejectionDistance);
1293  iConfig.addParameter<double>("cosmicRejectionDistance",cosmicRejectionDistance);
1294 
1295  try {
1297 }
1298  catch( std::exception& err ) {
1299  cerr<<"exception setting PFAlgo Muon and Fake parameters: "
1300  <<err.what()<<". terminating."<<endl;
1301  delete this;
1302  exit(1);
1303  }
1304 
1305  bool postHFCleaning = true;
1306  options_->GetOpt("particle_flow", "postHFCleaning", postHFCleaning);
1307  double minHFCleaningPt = 5.;
1308  options_->GetOpt("particle_flow", "minHFCleaningPt", minHFCleaningPt);
1309  double minSignificance = 2.5;
1310  options_->GetOpt("particle_flow", "minSignificance", minSignificance);
1311  double maxSignificance = 2.5;
1312  options_->GetOpt("particle_flow", "maxSignificance", maxSignificance);
1313  double minSignificanceReduction = 1.4;
1314  options_->GetOpt("particle_flow", "minSignificanceReduction", minSignificanceReduction);
1315  double maxDeltaPhiPt = 7.0;
1316  options_->GetOpt("particle_flow", "maxDeltaPhiPt", maxDeltaPhiPt);
1317  double minDeltaMet = 0.4;
1318  options_->GetOpt("particle_flow", "minDeltaMet", minDeltaMet);
1319 
1320  // Set post HF cleaning muon parameters
1321  try {
1322  pfAlgo_.setPostHFCleaningParameters(postHFCleaning,
1323  minHFCleaningPt,
1324  minSignificance,
1325  maxSignificance,
1326  minSignificanceReduction,
1327  maxDeltaPhiPt,
1328  minDeltaMet);
1329  }
1330  catch( std::exception& err ) {
1331  cerr<<"exception setting post HF cleaning parameters: "
1332  <<err.what()<<". terminating."<<endl;
1333  delete this;
1334  exit(1);
1335  }
1336 
1337  useAtHLT_ = false;
1338  options_->GetOpt("particle_flow", "useAtHLT", useAtHLT_);
1339  cout<<"use HLT tracking "<<useAtHLT_<<endl;
1340 
1341  useHO_ = true;
1342  options_->GetOpt("particle_flow", "useHO", useHO_);
1343  cout<<"use of HO "<<useHO_<<endl;
1344 
1345 
1346  usePFElectrons_ = false; // set true to use PFElectrons
1347  options_->GetOpt("particle_flow", "usePFElectrons", usePFElectrons_);
1348  cout<<"use PFElectrons "<<usePFElectrons_<<endl;
1349 
1350  if( usePFElectrons_ ) {
1351  // PFElectrons options -----------------------------
1352  double mvaEleCut = -1.; // if = -1. get all the pre-id electrons
1353  options_->GetOpt("particle_flow", "electron_mvaCut", mvaEleCut);
1354 
1355  bool applyCrackCorrections=true;
1356  options_->GetOpt("particle_flow","electron_crackCorrection",applyCrackCorrections);
1357 
1358  string mvaWeightFileEleID = "";
1359  options_->GetOpt("particle_flow", "electronID_mvaWeightFile",
1360  mvaWeightFileEleID);
1361  mvaWeightFileEleID = expand(mvaWeightFileEleID);
1362 
1363  std::string egammaElectronstagname;
1364  options_->GetOpt("particle_flow","egammaElectrons",egammaElectronstagname);
1365  egammaElectronsTag_ = edm::InputTag(egammaElectronstagname);
1366 
1367  //HO in the algorithm or not
1370 
1371  try {
1372  pfAlgo_.setPFEleParameters(mvaEleCut,
1373  mvaWeightFileEleID,
1375  thePFSCEnergyCalibration,
1376  calibration,
1377  sumEtEcalIsoForEgammaSC_barrel,
1378  sumEtEcalIsoForEgammaSC_endcap,
1379  coneEcalIsoForEgammaSC,
1380  sumPtTrackIsoForEgammaSC_barrel,
1381  sumPtTrackIsoForEgammaSC_endcap,
1382  nTrackIsoForEgammaSC,
1383  coneTrackIsoForEgammaSC,
1384  applyCrackCorrections,
1385  usePFSCEleCalib,
1387  useEGammaSupercluster);
1388  }
1389  catch( std::exception& err ) {
1390  cerr<<"exception setting PFAlgo Electron parameters: "
1391  <<err.what()<<". terminating."<<endl;
1392  delete this;
1393  exit(1);
1394  }
1395  }
1396 
1397  bool usePFPhotons = true;
1398  bool useReg=false;
1399  string mvaWeightFileConvID = "";
1400  string mvaWeightFileRegLCEB="";
1401  string mvaWeightFileRegLCEE="";
1402  string mvaWeightFileRegGCEB="";
1403  string mvaWeightFileRegGCEEhr9="";
1404  string mvaWeightFileRegGCEElr9="";
1405  string mvaWeightFileRegRes="";
1406  string X0Map="";
1407  double mvaConvCut=-1.;
1408  double sumPtTrackIsoForPhoton=2.0;
1409  double sumPtTrackIsoSlopeForPhoton=0.001;
1410  options_->GetOpt("particle_flow", "usePFPhotons", usePFPhotons);
1411  options_->GetOpt("particle_flow", "conv_mvaCut", mvaConvCut);
1412  options_->GetOpt("particle_flow", "useReg", useReg);
1413  options_->GetOpt("particle_flow", "convID_mvaWeightFile", mvaWeightFileConvID);
1414  options_->GetOpt("particle_flow", "mvaWeightFileRegLCEB", mvaWeightFileRegLCEB);
1415  options_->GetOpt("particle_flow", "mvaWeightFileRegLCEE", mvaWeightFileRegLCEE);
1416  options_->GetOpt("particle_flow", "mvaWeightFileRegGCEB", mvaWeightFileRegGCEB);
1417  options_->GetOpt("particle_flow", "mvaWeightFileRegGCEEHr9", mvaWeightFileRegGCEEhr9);
1418  options_->GetOpt("particle_flow", "mvaWeightFileRegGCEELr9", mvaWeightFileRegGCEElr9);
1419  options_->GetOpt("particle_flow", "mvaWeightFileRegRes", mvaWeightFileRegRes);
1420  options_->GetOpt("particle_flow", "X0Map", X0Map);
1421  options_->GetOpt("particle_flow","sumPtTrackIsoForPhoton",sumPtTrackIsoForPhoton);
1422  options_->GetOpt("particle_flow","sumPtTrackIsoSlopeForPhoton",sumPtTrackIsoSlopeForPhoton);
1423  // cout<<"use PFPhotons "<<usePFPhotons<<endl;
1424 
1425  if( usePFPhotons ) {
1426  // PFPhoton options -----------------------------
1427  TFile *infile_PFLCEB = new TFile(mvaWeightFileRegLCEB.c_str(),"READ");
1428  TFile *infile_PFLCEE = new TFile(mvaWeightFileRegLCEE.c_str(),"READ");
1429  TFile *infile_PFGCEB = new TFile(mvaWeightFileRegGCEB.c_str(),"READ");
1430  TFile *infile_PFGCEEhR9 = new TFile(mvaWeightFileRegGCEEhr9.c_str(),"READ");
1431  TFile *infile_PFGCEElR9 = new TFile(mvaWeightFileRegGCEElr9.c_str(),"READ");
1432  TFile *infile_PFRes = new TFile(mvaWeightFileRegRes.c_str(),"READ");
1433 
1434  const GBRForest *gbrLCBar = (GBRForest*)infile_PFLCEB->Get("PFLCorrEB");
1435  const GBRForest *gbrLCEnd = (GBRForest*)infile_PFLCEE->Get("PFLCorrEE");
1436  const GBRForest *gbrGCEB = (GBRForest*)infile_PFGCEB->Get("PFGCorrEB");
1437  const GBRForest *gbrGCEEhr9 = (GBRForest*)infile_PFGCEEhR9->Get("PFGCorrEEHr9");
1438  const GBRForest *gbrGCEElr9 = (GBRForest*)infile_PFGCEElR9->Get("PFGCorrEELr9");
1439  const GBRForest *gbrRes = (GBRForest*)infile_PFRes->Get("PFRes");
1440  try {
1442  (usePFPhotons,
1443  mvaWeightFileConvID,
1444  mvaConvCut,
1445  useReg,
1446  X0Map,
1447  calibration,
1448  sumPtTrackIsoForPhoton,
1449  sumPtTrackIsoSlopeForPhoton
1450  );
1451  pfAlgo_.setPFPhotonRegWeights(gbrLCBar, gbrLCEnd,gbrGCEB,
1452  gbrGCEEhr9,gbrGCEElr9,
1453  gbrRes
1454  );
1455 
1456  }
1457  catch( std::exception& err ) {
1458  cerr<<"exception setting PFAlgo Photon parameters: "
1459  <<err.what()<<". terminating."<<endl;
1460  delete this;
1461  exit(1);
1462  }
1463  }
1464 
1465 
1466 
1467  bool rejectTracks_Bad = true;
1468  bool rejectTracks_Step45 = true;
1469  bool usePFConversions = false; // set true to use PFConversions
1470  bool usePFNuclearInteractions = false;
1471  bool usePFV0s = false;
1472 
1473 
1474  double dptRel_DispVtx = 10;
1475 
1476 
1477  options_->GetOpt("particle_flow", "usePFConversions", usePFConversions);
1478  options_->GetOpt("particle_flow", "usePFV0s", usePFV0s);
1479  options_->GetOpt("particle_flow", "usePFNuclearInteractions", usePFNuclearInteractions);
1480  options_->GetOpt("particle_flow", "dptRel_DispVtx", dptRel_DispVtx);
1481 
1482  try {
1483  pfAlgo_.setDisplacedVerticesParameters(rejectTracks_Bad,
1484  rejectTracks_Step45,
1485  usePFNuclearInteractions,
1486  usePFConversions,
1487  usePFV0s,
1488  dptRel_DispVtx);
1489 
1490  }
1491  catch( std::exception& err ) {
1492  cerr<<"exception setting PFAlgo displaced vertex parameters: "
1493  <<err.what()<<". terminating."<<endl;
1494  delete this;
1495  exit(1);
1496  }
1497 
1498  bool bCorrect = false;
1499  bool bCalibPrimary = false;
1500  double dptRel_PrimaryTrack = 0;
1501  double dptRel_MergedTrack = 0;
1502  double ptErrorSecondary = 0;
1503  vector<double> nuclCalibFactors;
1504 
1505  options_->GetOpt("particle_flow", "bCorrect", bCorrect);
1506  options_->GetOpt("particle_flow", "bCalibPrimary", bCalibPrimary);
1507  options_->GetOpt("particle_flow", "dptRel_PrimaryTrack", dptRel_PrimaryTrack);
1508  options_->GetOpt("particle_flow", "dptRel_MergedTrack", dptRel_MergedTrack);
1509  options_->GetOpt("particle_flow", "ptErrorSecondary", ptErrorSecondary);
1510  options_->GetOpt("particle_flow", "nuclCalibFactors", nuclCalibFactors);
1511 
1512  try {
1513  pfAlgo_.setCandConnectorParameters(bCorrect, bCalibPrimary, dptRel_PrimaryTrack, dptRel_MergedTrack, ptErrorSecondary, nuclCalibFactors);
1514  }
1515  catch( std::exception& err ) {
1516  cerr<<"exception setting PFAlgo cand connector parameters: "
1517  <<err.what()<<". terminating."<<endl;
1518  delete this;
1519  exit(1);
1520  }
1521 
1522 
1523 
1524 
1525  int algo = 2;
1526  options_->GetOpt("particle_flow", "algorithm", algo);
1527 
1528  pfAlgo_.setAlgo( algo );
1529  // pfAlgoOther_.setAlgo( 1 );
1530 
1531 
1532  // jets options ---------------------------------
1533 
1534  doJets_ = false;
1535  options_->GetOpt("jets", "on/off", doJets_);
1536 
1537  jetsDebug_ = false;
1538  options_->GetOpt("jets", "debug", jetsDebug_);
1539 
1540  jetAlgoType_=3; //FastJet as Default
1541  options_->GetOpt("jets", "algo", jetAlgoType_);
1542 
1543  double mEtInputCut = 0.5;
1544  options_->GetOpt("jets", "EtInputCut", mEtInputCut);
1545 
1546  double mEInputCut = 0.;
1547  options_->GetOpt("jets", "EInputCut", mEInputCut);
1548 
1549  double seedThreshold = 1.0;
1550  options_->GetOpt("jets", "seedThreshold", seedThreshold);
1551 
1552  double coneRadius = 0.5;
1553  options_->GetOpt("jets", "coneRadius", coneRadius);
1554 
1555  double coneAreaFraction= 1.0;
1556  options_->GetOpt("jets", "coneAreaFraction", coneAreaFraction);
1557 
1558  int maxPairSize=2;
1559  options_->GetOpt("jets", "maxPairSize", maxPairSize);
1560 
1561  int maxIterations=100;
1562  options_->GetOpt("jets", "maxIterations", maxIterations);
1563 
1564  double overlapThreshold = 0.75;
1565  options_->GetOpt("jets", "overlapThreshold", overlapThreshold);
1566 
1567  double ptMin = 10.;
1568  options_->GetOpt("jets", "ptMin", ptMin);
1569 
1570  double rparam = 1.0;
1571  options_->GetOpt("jets", "rParam", rparam);
1572 
1573  jetMaker_.setmEtInputCut (mEtInputCut);
1574  jetMaker_.setmEInputCut(mEInputCut);
1575  jetMaker_.setSeedThreshold(seedThreshold);
1576  jetMaker_.setConeRadius(coneRadius);
1577  jetMaker_.setConeAreaFraction(coneAreaFraction);
1578  jetMaker_.setMaxPairSize(maxPairSize);
1579  jetMaker_.setMaxIterations(maxIterations) ;
1580  jetMaker_.setOverlapThreshold(overlapThreshold) ;
1581  jetMaker_.setPtMin (ptMin);
1582  jetMaker_.setRParam (rparam);
1585  cout <<"Opt: doJets? " << doJets_ <<endl;
1586  cout <<"Opt: jetsDebug " << jetsDebug_ <<endl;
1587  cout <<"Opt: algoType " << jetAlgoType_ <<endl;
1588  cout <<"----------------------------------" << endl;
1589 
1590 
1591  // tau benchmark options ---------------------------------
1592 
1593  doTauBenchmark_ = false;
1594  options_->GetOpt("tau_benchmark", "on/off", doTauBenchmark_);
1595 
1596  if (doTauBenchmark_) {
1597  double coneAngle = 0.5;
1598  options_->GetOpt("tau_benchmark", "cone_angle", coneAngle);
1599 
1600  double seedEt = 0.4;
1601  options_->GetOpt("tau_benchmark", "seed_et", seedEt);
1602 
1603  double coneMerge = 100.0;
1604  options_->GetOpt("tau_benchmark", "cone_merge", coneMerge);
1605 
1606  options_->GetOpt("tau_benchmark", "debug", tauBenchmarkDebug_);
1607 
1608  // cout<<"jets debug "<<jetsDebug_<<endl;
1609 
1610  if( tauBenchmarkDebug_ ) {
1611  cout << "Tau Benchmark Options : ";
1612  cout << "Angle=" << coneAngle << " seedEt=" << seedEt
1613  << " Merge=" << coneMerge << endl;
1614  }
1615 
1616  jetAlgo_.SetConeAngle(coneAngle);
1617  jetAlgo_.SetSeedEt(seedEt);
1618  jetAlgo_.SetConeMerge(coneMerge);
1619  }
1620 
1621 
1622 
1623  // print flags -------------
1624 
1625  printRecHits_ = false;
1626  printRecHitsEMin_ = 0.;
1627  options_->GetOpt("print", "rechits", printRecHits_ );
1628  options_->GetOpt("print", "rechits_emin", printRecHitsEMin_ );
1629 
1630  printClusters_ = false;
1631  printClustersEMin_ = 0.;
1632  options_->GetOpt("print", "clusters", printClusters_ );
1633  options_->GetOpt("print", "clusters_emin", printClustersEMin_ );
1634 
1635  printPFBlocks_ = false;
1636  options_->GetOpt("print", "PFBlocks", printPFBlocks_ );
1637 
1638  printPFCandidates_ = true;
1640  options_->GetOpt("print", "PFCandidates", printPFCandidates_ );
1641  options_->GetOpt("print", "PFCandidates_ptmin", printPFCandidatesPtMin_ );
1642 
1643  printPFJets_ = true;
1644  printPFJetsPtMin_ = 0.;
1645  options_->GetOpt("print", "jets", printPFJets_ );
1646  options_->GetOpt("print", "jets_ptmin", printPFJetsPtMin_ );
1647 
1648  printSimParticles_ = true;
1650  options_->GetOpt("print", "simParticles", printSimParticles_ );
1651  options_->GetOpt("print", "simParticles_ptmin", printSimParticlesPtMin_ );
1652 
1653  printGenParticles_ = true;
1655  options_->GetOpt("print", "genParticles", printGenParticles_ );
1656  options_->GetOpt("print", "genParticles_ptmin", printGenParticlesPtMin_ );
1657 
1658  //MCTruthMatching Tool set to false by default
1659  //can only be used with fastsim and the UnFoldedMode set to true
1660  //when generating the simulated file
1661  printMCTruthMatching_ = false;
1662  options_->GetOpt("print", "mctruthmatching", printMCTruthMatching_ );
1663 
1664 
1665  verbosity_ = VERBOSE;
1666  options_->GetOpt("print", "verbosity", verbosity_ );
1667  cout<<"verbosity : "<<verbosity_<<endl;
1668 
1669 
1670 
1671 
1672 
1673 }
void setmEInputCut(double amEInputCut)
Minimum E for jet constituents.
bool useAtHLT_
Use HLT tracking.
bool doMet_
MET on/off.
void setThreshCleanBarrel(double thresh)
set barrel clean threshold
Definition: PFClusterAlgo.h:69
void setOverlapThreshold(double aOverlapThreshold)
????
void reset()
reset before next event
void setThreshDoubleSpikeEndcap(double thresh)
set endcap thresholds for double spike cleaning
Definition: PFClusterAlgo.h:89
void setParameters(Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool metSpHistos)
set the parameters locally
Definition: PFMETMonitor.cc:58
PFClusterAlgo clusterAlgoHFEM_
clustering algorithm for HF, electro-magnetic layer
void setDirectory(TDirectory *dir)
set directory (to use in ROOT)
PFMETMonitor pfMETMonitor_
void SetConeMerge(double coneMerge)
bool tauBenchmarkDebug_
tau benchmark debug
bool printPFJets_
print PFJets yes/no
PFClusterAlgo clusterAlgoHO_
clustering algorithm for HO
boost::shared_ptr< PFEnergyCalibration > calibration_
void setShowerSigma(double sigma)
set shower sigma for
bool printPFBlocks_
print PFBlocks yes/no
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.
General option file parser.
Definition: IO.h:28
void setPFMuonAndFakeParameters(const edm::ParameterSet &pset)
Definition: PFAlgo.cc:230
bool onlyTwoJets
bool useConvBremPFRecTracks_
Use Conv Brem KF Tracks.
void setPosCalcP1(double p1)
set p1 for position calculation
Definition: PFClusterAlgo.h:99
bool debug_
debug printouts for this PFRootEventManager on/off
void setDirectory(TDirectory *dir)
set directory (to use in ROOT)
boost::shared_ptr< PFEnergyCalibrationHF > thepfEnergyCalibrationHF_
static void setDepthCorParameters(int mode, double a, double b, double ap, double bp)
Definition: PFCluster.h:104
void setPosCalcNCrystal(int n)
set number of crystals for position calculation (-1 all,5, or 9)
double deltaRMax
void setThreshSeedBarrel(double thresh)
set barrel seed threshold
Definition: PFClusterAlgo.h:65
void setHOTag(bool ho)
Definition: PFBlockAlgo.h:202
void setCandConnectorParameters(const edm::ParameterSet &iCfgCandConnector)
Definition: PFAlgo.h:71
void setS6S2DoubleSpikeEndcap(double cut)
Definition: PFClusterAlgo.h:90
IO * options_
options file parser
void setmEtInputCut(double amEtInputCut)
Minimum ET for jet constituents.
void setSeedThreshold(double aSeedThreshold)
Set seed to start jet reconstruction.
void setMaxIterations(int amaxIteration)
????
General CMS geometry parameters used during Particle Flow reconstruction or drawing. All methods and members are static.
Definition: PFGeometry.h:23
edm::InputTag egammaElectronsTag_
bool usePFElectrons_
Use PFElectrons.
void setDisplacedVerticesParameters(bool rejectTracks_Bad, bool rejectTracks_Step45, bool usePFNuclearInteractions, bool usePFConversions, bool usePFDecays, double dptRel_DispVtx)
Definition: PFAlgo.cc:282
void setThreshBarrel(double thresh)
setters -------------------------------------------------——
Definition: PFClusterAlgo.h:61
PFClusterAlgo clusterAlgoECAL_
void setConeRadius(double aConeRadius)
Set radius of the cone.
void setUseCornerCells(bool usecornercells)
activate use of cells with a common corner to build topo-clusters
string outjetfilename
void setPFEleParameters(double mvaEleCut, std::string mvaWeightFileEleID, bool usePFElectrons, const boost::shared_ptr< PFSCEnergyCalibration > &thePFSCEnergyCalibration, const boost::shared_ptr< PFEnergyCalibration > &thePFEnergyCalibration, double sumEtEcalIsoForEgammaSC_barrel, double sumEtEcalIsoForEgammaSC_endcap, double coneEcalIsoForEgammaSC, double sumPtTrackIsoForEgammaSC_barrel, double sumPtTrackIsoForEgammaSC_endcap, unsigned int nTrackIsoForEgammaSC, double coneTrackIsoForEgammaSC, bool applyCrackCorrections=false, bool usePFSCEleCalib=true, bool useEGElectrons=false, bool useEGammaSupercluster=true)
Definition: PFAlgo.cc:95
bool doJets_
jets on/off
void setPFPhotonParameters(bool usePFPhoton, std::string mvaWeightFileConvID, double mvaConvCut, bool useReg, std::string X0_Map, const boost::shared_ptr< PFEnergyCalibration > &thePFEnergyCalibration, double sumPtTrackIsoForPhoton, double sumPtTrackIsoSlopeForPhoton)
Definition: PFAlgo.cc:157
bool GetOpt(const char *tag, const char *key, std::vector< T > &values) const
reads a vector of T
Definition: IO.h:106
bool doPFMETBenchmark_
PFMET benchmark on/off.
void setThreshPtSeedBarrel(double thresh)
Definition: PFClusterAlgo.h:66
PFJetAlgorithm jetAlgo_
void setThreshSeedEndcap(double thresh)
set endcap seed threshold
Definition: PFClusterAlgo.h:81
std::vector< int > filterTaus_
void setup(std::string Filename, bool debug, bool plotAgainstReco=0, bool onlyTwoJets=1, double deltaRMax=0.1, std::string benchmarkLabel_="ParticleFlow", double recPt=-1, double maxEta=-1, DQMStore *dbe_store=NULL)
bool jetsDebug_
debug printouts for jet algo on/off
bool printClusters_
print clusters yes/no
void setDebug(bool debug)
Definition: PFAlgo.h:64
TTree * outTree_
output tree
void setParameters(double nSigmaECAL, double nSigmaHCAL, const boost::shared_ptr< PFEnergyCalibration > &calibration, const boost::shared_ptr< PFEnergyCalibrationHF > &thepfEnergyCalibrationHF)
Definition: PFAlgo.cc:75
TFile * outFile_
output file
void setup()
book histograms
void setDebug(bool debug)
sets debug printout flag
Definition: PFBlockAlgo.h:183
PFJetMonitor pfJetMonitor_
std::ofstream * calibFile_
void setParameters(float dRMax, bool matchCharge, Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool fracHistoFlag=true)
set the parameters locally
Definition: PFJetMonitor.cc:62
void setNNeighbours(int n)
set number of neighbours for
Definition: PFClusterAlgo.h:96
void setParameters(float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT)
set the benchmark parameters
bool doParticleFlow_
particle flow on/off
void setPFPhotonRegWeights(const GBRForest *LCorrForestEB, const GBRForest *LCorrForestEE, const GBRForest *GCorrForestBarrel, const GBRForest *GCorrForestEndcapHr9, const GBRForest *GCorrForestEndcapLr9, const GBRForest *PFEcalResolution)
Definition: PFAlgo.cc:217
PFClusterAlgo clusterAlgoHCAL_
clustering algorithm for HCAL
PFCandidateManager pfCandidateManager_
bool printPFCandidates_
print PFCandidates yes/no
void setS4S1CleanBarrel(const std::vector< double > &coeffs)
Definition: PFClusterAlgo.h:70
bool useKDTreeTrackEcalLinker_
ECAL-track link optimization.
void SetConeAngle(double coneAngle)
void setThreshPtSeedEndcap(double thresh)
Definition: PFClusterAlgo.h:82
void SetSeedEt(double et)
bool findRecHitNeighbours_
find rechit neighbours ?
void setPostHFCleaningParameters(bool postHFCleaning, double minHFCleaningPt, double minSignificance, double maxSignificance, double minSignificanceReduction, double maxDeltaPhiPt, double minDeltaMet)
Definition: PFAlgo.cc:265
void setThreshPtEndcap(double thresh)
Definition: PFClusterAlgo.h:78
void setDebug(bool aDebug)
PFAlgo pfAlgo_
particle flow algorithm
void setThreshEndcap(double thresh)
set endcap threshold
Definition: PFClusterAlgo.h:77
std::string expand(const std::string &oldString) const
void setThreshDoubleSpikeBarrel(double thresh)
set endcap thresholds for double spike cleaning
Definition: PFClusterAlgo.h:73
void setHOTag(bool ho)
Definition: PFAlgo.h:60
void setConeAreaFraction(double aConeAreaFraction)
Set fraction of (alowed) overlapping.
void setParameters(std::vector< double > &DPtovPtCut, std::vector< unsigned > &NHitCut, bool useConvBremPFRecTracks, bool useIterTracking, int nuclearInteractionsPurity, bool useEGPhotons, std::vector< double > &photonSelectionCuts, bool useSuperClusters)
Definition: PFBlockAlgo.cc:31
void setDirectory(TDirectory *dir)
set directory (to use in ROOT)
bool plotAgainstReco
void connect(const char *infilename="")
open the root file and connect to the tree
bool doTauBenchmark_
tau benchmark on/off
PFBlockAlgo pfBlockAlgo_
algorithm for building the particle flow blocks
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
Definition: Benchmark.h:51
bool pfjBenchmarkDebug
PFClusterAlgo clusterAlgoPS_
clustering algorithm for PS
virtual void readSpecificOptions(const char *file)
bool doPFJetBenchmark_
PFJet benchmark on/off.
std::auto_ptr< METManager > metManager_
void setThreshPtBarrel(double thresh)
Definition: PFClusterAlgo.h:62
bool useHO_
Use of HO in links with tracks/HCAL and in particle flow reconstruction.
void setCleanRBXandHPDs(bool cleanRBXandHPDs)
Activate cleaning of HCAL RBX&#39;s and HPD&#39;s.
bool printSimParticles_
print true particles yes/no
void setS6S2DoubleSpikeBarrel(double cut)
Definition: PFClusterAlgo.h:74
void enableDebugging(bool debug)
set hits on which clustering will be performed
Definition: PFClusterAlgo.h:45
void setS4S1CleanEndcap(const std::vector< double > &coeffs)
Definition: PFClusterAlgo.h:86
tuple cout
Definition: gather_cfg.py:121
double MET1cut
PFMET Benchmark.
void setRParam(double aRparam)
int verbosity_
verbosity
dbl *** dir
Definition: mlp_gen.cc:35
PFClusterAlgo clusterAlgoHFHAD_
clustering algorithm for HF, hadronic layer
void setUseOptimization(bool useKDTreeTrackEcalLinker)
Definition: PFBlockAlgo.cc:64
void setMaxPairSize(int aMaxPairSize)
????
void setThreshCleanEndcap(double thresh)
set endcap clean threshold
Definition: PFClusterAlgo.h:85
void setup()
book histograms
void setHistos(TFile *file, TH2F *hB, TH2F *hE)
set endcap clean threshold
Definition: PFClusterAlgo.h:93
bool JECinCaloMet_
propagate the Jet Energy Corrections to the caloMET on/off
bool fastsim_
Fastsim or fullsim.
void setPtMin(double aPtMin)
bool useEGElectrons_
Use EGElectrons.
void setAlgo(int algo)
Definition: PFAlgo.h:61
bool useEGPhotons_
Use EGPhotons.
bool doCompare_
comparison with pf CMSSW
bool printGenParticles_
print MC truth yes/no
void setup()
book histograms
tuple minTrackerHits
Definition: align_cfg.py:26
FWLiteJetProducer jetMaker_
wrapper to official jet algorithms
bool printRecHits_
print rechits yes/no
int jetAlgoType_
jet algo type
virtual void PFRootEventManager::readSpecificOptions ( const char *  file)
inlinevirtual

Reimplemented in PFRootEventManagerColin.

Definition at line 225 of file PFRootEventManager.h.

Referenced by readOptions().

225 {}
void PFRootEventManager::reconstructCaloJets ( )

reconstruct calo jets

Definition at line 3325 of file PFRootEventManager.cc.

References caloJets_, caloTowers_, caloTowersPtrs_, edm::PtrVectorBase::clear(), gather_cfg::cout, i, jetsDebug_, ProtoJet::pt(), edm::PtrVector< T >::push_back(), reconstructFWLiteJets(), edm::SortedCollection< T, SORT >::size(), VERBOSE, and verbosity_.

Referenced by processEntry().

3325  {
3326 
3327  if (verbosity_ == VERBOSE || jetsDebug_ ) {
3328  cout<<endl;
3329  cout<<"start reconstruct CaloJets --- "<<endl;
3330  }
3331  caloJets_.clear();
3333 
3334  for( unsigned i=0; i<caloTowers_.size(); i++) {
3335  reco::CandidatePtr candPtr( &caloTowers_, i );
3336  caloTowersPtrs_.push_back( candPtr );
3337  }
3338 
3340 
3341  if (jetsDebug_ ) {
3342  for(unsigned ipj=0; ipj<caloJets_.size(); ipj++) {
3343  const ProtoJet& protojet = caloJets_[ipj];
3344  cout<<" calo jet "<<ipj<<" "<<protojet.pt() <<endl;
3345  }
3346  }
3347 
3348 }
CaloTowerCollection caloTowers_
int i
Definition: DBlmapReader.cc:9
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:137
reco::CandidatePtrVector caloTowersPtrs_
Transient Jet class used by the reconstruction algorithms.
Definition: ProtoJet.h:25
std::vector< ProtoJet > caloJets_
calo Jets
void reconstructFWLiteJets(const reco::CandidatePtrVector &Candidates, std::vector< ProtoJet > &output)
used by the reconstruct*Jets functions
double pt() const
Definition: ProtoJet.h:75
bool jetsDebug_
debug printouts for jet algo on/off
void clear()
Clear the PtrVector.
Definition: PtrVectorBase.h:79
size_type size() const
tuple cout
Definition: gather_cfg.py:121
int verbosity_
verbosity
void PFRootEventManager::reconstructFWLiteJets ( const reco::CandidatePtrVector Candidates,
std::vector< ProtoJet > &  output 
)

used by the reconstruct*Jets functions

Produce jet collection using CMS Iterative Cone Algorithm

Definition at line 3408 of file PFRootEventManager.cc.

References FWLiteJetProducer::applyCuts(), gather_cfg::cout, LaserDQM_cfg::input, jetAlgoType_, jetMaker_, FWLiteJetProducer::makeFastJets(), FWLiteJetProducer::makeIterativeConeJets(), and FWLiteJetProducer::makeMidpointJets().

Referenced by reconstructCaloJets(), reconstructGenJets(), and reconstructPFJets().

3408  {
3409 
3410  // cout<<"!!! Make FWLite Jets "<<endl;
3412  // vector<ProtoJet> output;
3413  jetMaker_.applyCuts (Candidates, &input);
3414  if (jetAlgoType_==1) {// ICone
3417  }
3418  if (jetAlgoType_==2) {// MCone
3420  }
3421  if (jetAlgoType_==3) {// Fastjet
3422  jetMaker_.makeFastJets(input, &output);
3423  }
3424  if((jetAlgoType_>3)||(jetAlgoType_<0)) {
3425  cout<<"Unknown Jet Algo ! " <<jetAlgoType_ << endl;
3426  }
3427  //if (jetsDebug_) cout<<"Proto Jet Size " <<output.size()<<endl;
3428 
3429 }
void makeIterativeConeJets(const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput)
Produce jet collection using CMS Iterative Cone Algorithm.
std::vector< InputItem > InputCollection
Definition: JetRecoTypes.h:62
void applyCuts(const reco::CandidatePtrVector &Candidates, JetReco::InputCollection *input)
void makeMidpointJets(const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput)
Produce jet collection using CMS Midpoint Jet Algorithm.
void makeFastJets(const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput)
Produce jet collection using CMS Fast Jet Algorithm.
tuple cout
Definition: gather_cfg.py:121
FWLiteJetProducer jetMaker_
wrapper to official jet algorithms
int jetAlgoType_
jet algo type
void PFRootEventManager::reconstructGenJets ( )

reconstruct gen jets

Definition at line 3249 of file PFRootEventManager.cc.

References abs, reco::CompositePtrCandidate::begin(), edm::PtrVectorBase::clear(), gather_cfg::cout, reco::LeafCandidate::eta(), genJets_, genParticlesforJets_, genParticlesforJetsPtrs_, ProtoJet::getTowerList(), i, getHLTprescales::index, reco::isNeutrino(), ProtoJet::jetArea(), jetsDebug_, JetMaker::makeSpecific(), ProtoJet::nPasses(), reco::LeafCandidate::p(), ProtoJet::p4(), reco::LeafCandidate::pdgId(), reco::LeafCandidate::phi(), ProtoJet::pileup(), reco::LeafCandidate::pt(), edm::PtrVector< T >::push_back(), reconstructFWLiteJets(), edm::refToPtr(), edm::RefVector< C, T, F >::size(), timingPdfMaker::specific, reco::LeafCandidate::status(), VERBOSE, and verbosity_.

Referenced by processEntry().

3249  {
3250 
3251  if (verbosity_ == VERBOSE || jetsDebug_) {
3252  cout<<endl;
3253  cout<<"start reconstruct GenJets --- "<<endl;
3254  cout<< " input gen particles for jet: all neutrinos removed ; muons present" << endl;
3255  }
3256 
3257  genJets_.clear();
3259 
3260  if ( !genParticlesforJets_.size() ) return;
3261 
3262  for(unsigned i=0; i<genParticlesforJets_.size(); i++) {
3263 
3264  const reco::GenParticle& genPart = *(genParticlesforJets_[i]);
3265 
3266  // remove all muons/neutrinos for PFJet studies
3267  // if (reco::isNeutrino( genPart ) || reco::isMuon( genPart )) continue;
3268  // remove all neutrinos for PFJet studies
3269  if (reco::isNeutrino( genPart )) continue;
3270  // Work-around a bug in the pythia di-jet gun.
3271  if (std::abs(genPart.pdgId())<7 || std::abs(genPart.pdgId())==21 ) continue;
3272 
3273  if (jetsDebug_ ) {
3274  cout << " #" << i << " PDG code:" << genPart.pdgId()
3275  << " status " << genPart.status()
3276  << ", p/pt/eta/phi: " << genPart.p() << '/' << genPart.pt()
3277  << '/' << genPart.eta() << '/' << genPart.phi() << endl;
3278  }
3279 
3281  }
3282 
3283  vector<ProtoJet> protoJets;
3285 
3286 
3287  // Convert Protojets to GenJets
3288  int ijet = 0;
3289  typedef vector <ProtoJet>::const_iterator IPJ;
3290  for (IPJ ipj = protoJets.begin(); ipj != protoJets.end (); ipj++) {
3291  const ProtoJet& protojet = *ipj;
3292  const ProtoJet::Constituents& constituents = protojet.getTowerList();
3293 
3294  reco::Jet::Point vertex (0,0,0); // do not have true vertex yet, use default
3296  JetMaker::makeSpecific(constituents, &specific);
3297  // constructor without constituents
3298  GenJet newJet (protojet.p4(), vertex, specific);
3299 
3300  // last step is to copy the constituents into the jet (new jet definition since 18X)
3301  // namespace reco {
3302  //class Jet : public CompositeRefBaseCandidate {
3303  // public:
3304  // typedef reco::CandidateBaseRefVector Constituents;
3305 
3306  ProtoJet::Constituents::const_iterator constituent = constituents.begin();
3307  for (; constituent != constituents.end(); ++constituent) {
3308  // find index of this ProtoJet constituent in the overall collection PFconstit
3309  // see class IndexedCandidate in JetRecoTypes.h
3310  uint index = constituent->index();
3311  newJet.addDaughter( genParticlesforJetsPtrs_[index] );
3312  } // end loop on ProtoJet constituents
3313  // last step: copy ProtoJet Variables into Jet
3314  newJet.setJetArea(protojet.jetArea());
3315  newJet.setPileup(protojet.pileup());
3316  newJet.setNPasses(protojet.nPasses());
3317  ++ijet;
3318  if (jetsDebug_ ) cout<<" gen jet "<<ijet<<" "<<newJet.print()<<endl;
3319  genJets_.push_back (newJet);
3320 
3321  } // end loop on protojets iterator IPJ
3322 
3323 }
int i
Definition: DBlmapReader.cc:9
dictionary specific
JetReco::InputCollection Constituents
Definition: ProtoJet.h:28
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
Definition: RefToPtr.h:18
virtual double p() const GCC11_FINAL
magnitude of momentum vector
reco::GenParticleRefVector genParticlesforJets_
virtual int pdgId() const GCC11_FINAL
PDG identifier.
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:137
const Constituents & getTowerList()
Definition: ProtoJet.cc:82
reco::GenJetCollection genJets_
gen Jets
#define abs(x)
Definition: mlp_lapack.h:159
Transient Jet class used by the reconstruction algorithms.
Definition: ProtoJet.h:25
void reconstructFWLiteJets(const reco::CandidatePtrVector &Candidates, std::vector< ProtoJet > &output)
used by the reconstruct*Jets functions
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:25
bool jetsDebug_
debug printouts for jet algo on/off
virtual int status() const GCC11_FINAL
status word
float jetArea() const
Jet area as calculated by algorithm.
Definition: ProtoJet.cc:76
Jets made from MC generator particles.
Definition: GenJet.h:25
reco::CandidatePtrVector genParticlesforJetsPtrs_
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
bool makeSpecific(const JetReco::InputCollection &fConstituents, const CaloSubdetectorGeometry &fTowerGeometry, reco::CaloJet::Specific *fJetSpecific)
Make CaloJet specifics. Assumes ProtoJet is made from CaloTowerCandidates.
Definition: JetMaker.cc:21
virtual const_iterator begin() const
first daughter const_iterator
const LorentzVector & p4() const
Definition: ProtoJet.h:91
float pileup() const
pileup energy contribution as calculated by algorithm
Definition: ProtoJet.cc:78
void clear()
Clear the PtrVector.
Definition: PtrVectorBase.h:79
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
math::XYZPoint Point
point in the space
Definition: Candidate.h:45
tuple cout
Definition: gather_cfg.py:121
int verbosity_
verbosity
int nPasses() const
number of passes taken by algorithm
Definition: ProtoJet.cc:80
virtual float pt() const GCC11_FINAL
transverse momentum
void PFRootEventManager::reconstructPFJets ( )

reconstruct pf jets

Definition at line 3351 of file PFRootEventManager.cc.

References reco::CompositePtrCandidate::begin(), edm::PtrVectorBase::clear(), gather_cfg::cout, ProtoJet::getTowerList(), i, getHLTprescales::index, ProtoJet::jetArea(), jetsDebug_, JetMaker::makeSpecific(), ProtoJet::nPasses(), ProtoJet::p4(), pfCandidates_, pfCandidatesPtrs_, pfJets_, ProtoJet::pileup(), edm::PtrVector< T >::push_back(), reconstructFWLiteJets(), timingPdfMaker::specific, VERBOSE, and verbosity_.

Referenced by processEntry().

3351  {
3352 
3353  if (verbosity_ == VERBOSE || jetsDebug_) {
3354  cout<<endl;
3355  cout<<"start reconstruct PF Jets --- "<<endl;
3356  }
3357  pfJets_.clear();
3359 
3360  for( unsigned i=0; i<pfCandidates_->size(); i++) {
3361  reco::CandidatePtr candPtr( pfCandidates_.get(), i );
3362  pfCandidatesPtrs_.push_back( candPtr );
3363  }
3364 
3365  vector<ProtoJet> protoJets;
3367 
3368  // Convert Protojets to PFJets
3369 
3370  int ijet = 0;
3371  typedef vector <ProtoJet>::const_iterator IPJ;
3372  for (IPJ ipj = protoJets.begin(); ipj != protoJets.end (); ipj++) {
3373  const ProtoJet& protojet = *ipj;
3374  const ProtoJet::Constituents& constituents = protojet.getTowerList();
3375 
3376  reco::Jet::Point vertex (0,0,0); // do not have true vertex yet, use default
3378  JetMaker::makeSpecific(constituents, &specific);
3379  // constructor without constituents
3380  PFJet newJet (protojet.p4(), vertex, specific);
3381 
3382  // last step is to copy the constituents into the jet (new jet definition since 18X)
3383  // namespace reco {
3384  //class Jet : public CompositeRefBaseCandidate {
3385  // public:
3386  // typedef reco::CandidateBaseRefVector Constituents;
3387 
3388  ProtoJet::Constituents::const_iterator constituent = constituents.begin();
3389  for (; constituent != constituents.end(); ++constituent) {
3390  // find index of this ProtoJet constituent in the overall collection PFconstit
3391  // see class IndexedCandidate in JetRecoTypes.h
3392  uint index = constituent->index();
3393  newJet.addDaughter(pfCandidatesPtrs_[index]);
3394  } // end loop on ProtoJet constituents
3395  // last step: copy ProtoJet Variables into Jet
3396  newJet.setJetArea(protojet.jetArea());
3397  newJet.setPileup(protojet.pileup());
3398  newJet.setNPasses(protojet.nPasses());
3399  ++ijet;
3400  if (jetsDebug_ ) cout<<" PF jet "<<ijet<<" "<<newJet.print()<<endl;
3401  pfJets_.push_back (newJet);
3402 
3403  } // end loop on protojets iterator IPJ
3404 
3405 }
int i
Definition: DBlmapReader.cc:9
dictionary specific
JetReco::InputCollection Constituents
Definition: ProtoJet.h:28
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:137
const Constituents & getTowerList()
Definition: ProtoJet.cc:82
Transient Jet class used by the reconstruction algorithms.
Definition: ProtoJet.h:25
Jets made from PFObjects.
Definition: PFJet.h:22
void reconstructFWLiteJets(const reco::CandidatePtrVector &Candidates, std::vector< ProtoJet > &output)
used by the reconstruct*Jets functions
bool jetsDebug_
debug printouts for jet algo on/off
reco::CandidatePtrVector pfCandidatesPtrs_
float jetArea() const
Jet area as calculated by algorithm.
Definition: ProtoJet.cc:76
bool makeSpecific(const JetReco::InputCollection &fConstituents, const CaloSubdetectorGeometry &fTowerGeometry, reco::CaloJet::Specific *fJetSpecific)
Make CaloJet specifics. Assumes ProtoJet is made from CaloTowerCandidates.
Definition: JetMaker.cc:21
std::auto_ptr< reco::PFCandidateCollection > pfCandidates_
reconstructed pfCandidates
reco::PFJetCollection pfJets_
PF Jets.
virtual const_iterator begin() const
first daughter const_iterator
const LorentzVector & p4() const
Definition: ProtoJet.h:91
float pileup() const
pileup energy contribution as calculated by algorithm
Definition: ProtoJet.cc:78
void clear()
Clear the PtrVector.
Definition: PtrVectorBase.h:79
math::XYZPoint Point
point in the space
Definition: Candidate.h:45
tuple cout
Definition: gather_cfg.py:121
int verbosity_
verbosity
int nPasses() const
number of passes taken by algorithm
Definition: ProtoJet.cc:80
void PFRootEventManager::reset ( void  )

reset before next event

Definition at line 119 of file PFRootEventManager.cc.

References ev_, fwlite::ChainEvent::getTFile(), fwlite::ChainEvent::isValid(), outEvent_, outTree_, and EventColin::reset().

Referenced by processEntry(), and readOptions().

119  {
120 
121  if(outEvent_) {
122  outEvent_->reset();
123  outTree_->GetBranch("event")->SetAddress(&outEvent_);
124  }
125 
126  if ( ev_ && ev_->isValid() )
127  ev_->getTFile()->cd();
128 }
fwlite::ChainEvent * ev_
NEW: input event.
TFile * getTFile() const
Definition: ChainEvent.h:90
TTree * outTree_
output tree
bool isValid() const
Definition: ChainEvent.cc:292
void reset()
Definition: EventColin.h:12
void PFRootEventManager::setRecHitNeigbours ( reco::PFRecHit rh,
const std::map< unsigned, unsigned > &  detId2index 
)

for a given rechit, find the indices of the rechit neighbours, and store these indices in the rechit. The search is done in a detid to index map

Definition at line 2827 of file PFRootEventManager.cc.

References reco::PFRecHit::add4Neighbour(), reco::PFRecHit::add8Neighbour(), reco::PFRecHit::clearNeighbours(), i, reco::PFRecHit::neighboursIds4(), and reco::PFRecHit::neighboursIds8().

Referenced by PreprocessRecHits().

2828  {
2829 
2830  rh.clearNeighbours();
2831 
2832  vector<unsigned> neighbours4DetId = rh.neighboursIds4();
2833  vector<unsigned> neighbours8DetId = rh.neighboursIds8();
2834 
2835  for( unsigned i=0; i<neighbours4DetId.size(); i++) {
2836  unsigned detId = neighbours4DetId[i];
2837  // cout<<"finding n for detId "<<detId<<endl;
2838  const map<unsigned, unsigned>::const_iterator& it = detId2index.find(detId);
2839 
2840  if(it != detId2index.end() ) {
2841  // cout<<"found n index "<<it->second<<endl;
2842  rh.add4Neighbour( it->second );
2843  }
2844  }
2845 
2846  for( unsigned i=0; i<neighbours8DetId.size(); i++) {
2847  unsigned detId = neighbours8DetId[i];
2848  // cout<<"finding n for detId "<<detId<<endl;
2849  const map<unsigned, unsigned>::const_iterator& it = detId2index.find(detId);
2850 
2851  if(it != detId2index.end() ) {
2852  // cout<<"found n index "<<it->second<<endl;
2853  rh.add8Neighbour( it->second );
2854  }
2855  }
2856 
2857 
2858 }
void add4Neighbour(unsigned index)
Definition: PFRecHit.cc:176
int i
Definition: DBlmapReader.cc:9
void add8Neighbour(unsigned index)
Definition: PFRecHit.cc:181
void clearNeighbours()
Definition: PFRecHit.h:82
const std::vector< unsigned > & neighboursIds8() const
Definition: PFRecHit.h:166
const std::vector< unsigned > & neighboursIds4() const
Definition: PFRecHit.h:163
edm::InputTag PFRootEventManager::stringToTag ( const std::vector< std::string > &  tagname)

returns an InputTag from a vector of strings

Definition at line 5013 of file PFRootEventManager.cc.

References gather_cfg::cout.

5013  {
5014 
5015  if ( tagname.size() == 1 )
5016  return edm::InputTag(tagname[0]);
5017 
5018  else if ( tagname.size() == 2 )
5019  return edm::InputTag(tagname[0], tagname[1]);
5020 
5021  else if ( tagname.size() == 3 )
5022  return tagname[2] == '*' ?
5023  edm::InputTag(tagname[0], tagname[1]) :
5024  edm::InputTag(tagname[0], tagname[1], tagname[2]);
5025  else {
5026  cout << "Invalid tag name with " << tagname.size() << " strings "<< endl;
5027  return edm::InputTag();
5028  }
5029 
5030 }
tuple cout
Definition: gather_cfg.py:121
double PFRootEventManager::tauBenchmark ( const reco::PFCandidateCollection candidates)

COLIN need to get rid of this mess.

performs the tau benchmark TODO move this function and the associated datamembers out of here use an official benchmark from RecoParticleFlow/Benchmark

Definition at line 3435 of file PFRootEventManager.cc.

References abs, EventColin::addJetEHT(), EventColin::addJetMC(), EventColin::addJetPF(), caloTowers_, dtNoiseDBValidation_cfg::cerr, reco::LeafCandidate::charge(), PFJetAlgorithm::Clear(), gather_cfg::cout, EventColin::Jet::e, EventColin::Jet::ee, EventColin::Jet::eh, relval_parameters_module::energy, EventColin::Jet::et, EventColin::Jet::eta, eta(), EventColin::Jet::ete, EventColin::Jet::eth, fastsim_, PFJetAlgorithm::FindJets(), edm::HepMCProduct::GetEvent(), h_deltaETvisible_MCEHT_, h_deltaETvisible_MCPF_, i, cuy::ii, reco::isNeutrino(), metsig::jet, jetAlgo_, MCTruth_, reco::PFTrajectoryPoint::momentum(), outEvent_, reco::LeafCandidate::p4(), reco::PFCandidate::particleId(), reco::PFSimParticle::pdgCode(), phi, EventColin::Jet::phi, edm::SortedCollection< T, SORT >::size(), mathSSE::sqrt(), tauBenchmarkDebug_, trueParticles_, Utils::VectorEPRtoXYZ(), VERBOSE, and verbosity_.

Referenced by processEntry().

3435  {
3436  //std::cout << "building jets from MC particles,"
3437  // << "PF particles and caloTowers" << std::endl;
3438 
3439  //initialize Jets Reconstruction
3440  jetAlgo_.Clear();
3441 
3442  //COLIN The following comment is not really adequate,
3443  // since partTOTMC is not an action..
3444  // one should say what this variable is for.
3445  // see my comment later
3446  //MAKING TRUE PARTICLE JETS
3447 // TLorentzVector partTOTMC;
3448 
3449  // colin: the following is not necessary
3450  // since the lorentz vectors are initialized to 0,0,0,0.
3451  // partTOTMC.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
3452 
3453  //MAKING JETS WITH TAU DAUGHTERS
3454  //Colin: this vector vectPART is not necessary !!
3455  //it was just an efficient copy of trueparticles_.....
3456 // vector<reco::PFSimParticle> vectPART;
3457 // for ( unsigned i=0; i < trueParticles_.size(); i++) {
3458 // const reco::PFSimParticle& ptc = trueParticles_[i];
3459 // vectPART.push_back(ptc);
3460 // }//loop
3461 
3462 
3463  //COLIN one must not loop on trueParticles_ to find taus.
3464  //the code was giving wrong results on non single tau events.
3465 
3466  // first check that this is a single tau event.
3467 
3468  TLorentzVector partTOTMC;
3469  bool tauFound = false;
3470  bool tooManyTaus = false;
3471  if (fastsim_){
3472 
3473  for ( unsigned i=0; i < trueParticles_.size(); i++) {
3474  const reco::PFSimParticle& ptc = trueParticles_[i];
3475  if (std::abs(ptc.pdgCode()) == 15) {
3476  // this is a tau
3477  if( i ) tooManyTaus = true;
3478  else tauFound=true;
3479  }
3480  }
3481 
3482  if(!tauFound || tooManyTaus ) {
3483  // cerr<<"PFRootEventManager::tauBenchmark : not a single tau event"<<endl;
3484  return -9999;
3485  }
3486 
3487  // loop on the daugthers of the tau
3488  const std::vector<int>& ptcdaughters = trueParticles_[0].daughterIds();
3489 
3490  // will contain the sum of the lorentz vectors of the visible daughters
3491  // of the tau.
3492 
3493 
3494  for ( unsigned int dapt=0; dapt < ptcdaughters.size(); ++dapt) {
3495 
3496  const reco::PFTrajectoryPoint& tpatvtx
3497  = trueParticles_[ptcdaughters[dapt]].trajectoryPoint(0);
3498  TLorentzVector partMC;
3499  partMC.SetPxPyPzE(tpatvtx.momentum().Px(),
3500  tpatvtx.momentum().Py(),
3501  tpatvtx.momentum().Pz(),
3502  tpatvtx.momentum().E());
3503 
3504  partTOTMC += partMC;
3505  if (tauBenchmarkDebug_) {
3506  //pdgcode
3507  int pdgcode = trueParticles_[ptcdaughters[dapt]].pdgCode();
3508  cout << pdgcode << endl;
3509  cout << tpatvtx << endl;
3510  cout << partMC.Px() << " " << partMC.Py() << " "
3511  << partMC.Pz() << " " << partMC.E()
3512  << " PT="
3513  << sqrt(partMC.Px()*partMC.Px()+partMC.Py()*partMC.Py())
3514  << endl;
3515  }//debug
3516  }//loop daughter
3517  }else{
3518 
3519  uint itau=0;
3520  const HepMC::GenEvent* myGenEvent = MCTruth_.GetEvent();
3521  for ( HepMC::GenEvent::particle_const_iterator
3522  piter = myGenEvent->particles_begin();
3523  piter != myGenEvent->particles_end();
3524  ++piter ) {
3525 
3526 
3527  if (std::abs((*piter)->pdg_id())==15){
3528  itau++;
3529  tauFound=true;
3530  for ( HepMC::GenVertex::particles_out_const_iterator bp =
3531  (*piter)->end_vertex()->particles_out_const_begin();
3532  bp != (*piter)->end_vertex()->particles_out_const_end(); ++bp ) {
3533  uint nuId=std::abs((*bp)->pdg_id());
3534  bool isNeutrino=(nuId==12)||(nuId==14)||(nuId==16);
3535  if (!isNeutrino){
3536 
3537 
3538  TLorentzVector partMC;
3539  partMC.SetPxPyPzE((*bp)->momentum().x(),
3540  (*bp)->momentum().y(),
3541  (*bp)->momentum().z(),
3542  (*bp)->momentum().e());
3543  partTOTMC += partMC;
3544  }
3545  }
3546  }
3547  }
3548  if (itau>1) tooManyTaus=true;
3549 
3550  if(!tauFound || tooManyTaus ) {
3551  cerr<<"PFRootEventManager::tauBenchmark : not a single tau event"<<endl;
3552  return -9999;
3553  }
3554  }
3555 
3556 
3557  EventColin::Jet jetmc;
3558 
3559  jetmc.eta = partTOTMC.Eta();
3560  jetmc.phi = partTOTMC.Phi();
3561  jetmc.et = partTOTMC.Et();
3562  jetmc.e = partTOTMC.E();
3563 
3564  if(outEvent_) outEvent_->addJetMC( jetmc );
3565 
3566  /*
3567  //MC JETS RECONSTRUCTION (visible energy)
3568  for ( unsigned i=0; i < trueParticles_.size(); i++) {
3569  const reco::PFSimParticle& ptc = trueParticles_[i];
3570  const std::vector<int>& ptcdaughters = ptc.daughterIds();
3571 
3572  //PARTICULE NOT DISINTEGRATING BEFORE ECAL
3573  if(ptcdaughters.size() != 0) continue;
3574 
3575  //TAKE INFO AT VERTEX //////////////////////////////////////////////////
3576  const reco::PFTrajectoryPoint& tpatvtx = ptc.trajectoryPoint(0);
3577  TLorentzVector partMC;
3578  partMC.SetPxPyPzE(tpatvtx.momentum().Px(),
3579  tpatvtx.momentum().Py(),
3580  tpatvtx.momentum().Pz(),
3581  tpatvtx.momentum().E());
3582 
3583  partTOTMC += partMC;
3584  if (tauBenchmarkDebug_) {
3585  //pdgcode
3586  int pdgcode = ptc.pdgCode();
3587  cout << pdgcode << endl;
3588  cout << tpatvtx << endl;
3589  cout << partMC.Px() << " " << partMC.Py() << " "
3590  << partMC.Pz() << " " << partMC.E()
3591  << " PT="
3592  << sqrt(partMC.Px()*partMC.Px()+partMC.Py()*partMC.Py())
3593  << endl;
3594  }//debug?
3595  }//loop true particles
3596  */
3597  if (tauBenchmarkDebug_) {
3598  cout << " ET Vector=" << partTOTMC.Et()
3599  << " " << partTOTMC.Eta()
3600  << " " << partTOTMC.Phi() << endl; cout << endl;
3601  }//debug
3602 
3604  //CALO TOWER JETS (ECAL+HCAL Towers)
3605  //cout << endl;
3606  //cout << "THERE ARE " << caloTowers_.size() << " CALO TOWERS" << endl;
3607 
3608  vector<TLorentzVector> allcalotowers;
3609  // vector<double> allemenergy;
3610  // vector<double> allhadenergy;
3611  double threshCaloTowers = 1E-10;
3612  for ( unsigned int i = 0; i < caloTowers_.size(); ++i) {
3613 
3614  if(caloTowers_[i].energy() < threshCaloTowers) {
3615  // cout<<"skipping calotower"<<endl;
3616  continue;
3617  }
3618 
3619  TLorentzVector caloT;
3620  TVector3 pepr( caloTowers_[i].eta(),
3621  caloTowers_[i].phi(),
3622  caloTowers_[i].energy());
3623  TVector3 pxyz = Utils::VectorEPRtoXYZ( pepr );
3624  caloT.SetPxPyPzE(pxyz.X(),pxyz.Y(),pxyz.Z(),caloTowers_[i].energy());
3625  allcalotowers.push_back(caloT);
3626  // allemenergy.push_back( caloTowers_[i].emEnergy() );
3627  // allhadenergy.push_back( caloTowers_[i].hadEnergy() );
3628  }//loop calo towers
3629  if ( tauBenchmarkDebug_)
3630  cout << " RETRIEVED " << allcalotowers.size()
3631  << " CALOTOWER 4-VECTORS " << endl;
3632 
3633  //ECAL+HCAL tower jets computation
3634  jetAlgo_.Clear();
3635  const vector< PFJetAlgorithm::Jet >& caloTjets
3636  = jetAlgo_.FindJets( &allcalotowers );
3637 
3638  //cout << caloTjets.size() << " CaloTower Jets found" << endl;
3639  double JetEHTETmax = 0.0;
3640  for ( unsigned i = 0; i < caloTjets.size(); i++) {
3641  TLorentzVector jetmom = caloTjets[i].GetMomentum();
3642  double jetcalo_pt = sqrt(jetmom.Px()*jetmom.Px()+jetmom.Py()*jetmom.Py());
3643  double jetcalo_et = jetmom.Et();
3644 
3646  jet.eta = jetmom.Eta();
3647  jet.phi = jetmom.Phi();
3648  jet.et = jetmom.Et();
3649  jet.e = jetmom.E();
3650 
3651  const vector<int>& indexes = caloTjets[i].GetIndexes();
3652  for( unsigned ii=0; ii<indexes.size(); ii++){
3653  jet.ee += caloTowers_[ indexes[ii] ].emEnergy();
3654  jet.eh += caloTowers_[ indexes[ii] ].hadEnergy();
3655  jet.ete += caloTowers_[ indexes[ii] ].emEt();
3656  jet.eth += caloTowers_[ indexes[ii] ].hadEt();
3657  }
3658 
3659  if(outEvent_) outEvent_->addJetEHT( jet );
3660 
3661  if ( tauBenchmarkDebug_) {
3662  cout << " ECAL+HCAL jet : " << caloTjets[i] << endl;
3663  cout << jetmom.Px() << " " << jetmom.Py() << " "
3664  << jetmom.Pz() << " " << jetmom.E()
3665  << " PT=" << jetcalo_pt << endl;
3666  }//debug
3667 
3668  if (jetcalo_et >= JetEHTETmax)
3669  JetEHTETmax = jetcalo_et;
3670  }//loop MCjets
3671 
3673  //PARTICLE FLOW JETS
3674  vector<TLorentzVector> allrecparticles;
3675  // if ( tauBenchmarkDebug_) {
3676  // cout << endl;
3677  // cout << " THERE ARE " << pfBlocks_.size() << " EFLOW BLOCKS" << endl;
3678  // }//debug
3679 
3680  // for ( unsigned iefb = 0; iefb < pfBlocks_.size(); iefb++) {
3681  // const std::vector< PFBlockParticle >& recparticles
3682  // = pfBlocks_[iefb].particles();
3683 
3684 
3685 
3686  for(unsigned i=0; i<candidates.size(); i++) {
3687 
3688  // if (tauBenchmarkDebug_)
3689  // cout << " there are " << recparticles.size()
3690  // << " particle in this block" << endl;
3691 
3692  const reco::PFCandidate& candidate = candidates[i];
3693 
3694  if (tauBenchmarkDebug_) {
3695  cout << i << " " << candidate << endl;
3696  int type = candidate.particleId();
3697  cout << " type= " << type << " " << candidate.charge()
3698  << endl;
3699  }//debug
3700 
3701  const math::XYZTLorentzVector& PFpart = candidate.p4();
3702 
3703  TLorentzVector partRec(PFpart.Px(),
3704  PFpart.Py(),
3705  PFpart.Pz(),
3706  PFpart.E());
3707 
3708  //loading 4-vectors of Rec particles
3709  allrecparticles.push_back( partRec );
3710 
3711  }//loop on candidates
3712 
3713 
3714  if (tauBenchmarkDebug_)
3715  cout << " THERE ARE " << allrecparticles.size()
3716  << " RECONSTRUCTED 4-VECTORS" << endl;
3717 
3718  jetAlgo_.Clear();
3719  const vector< PFJetAlgorithm::Jet >& PFjets
3720  = jetAlgo_.FindJets( &allrecparticles );
3721 
3722  if (tauBenchmarkDebug_)
3723  cout << PFjets.size() << " PF Jets found" << endl;
3724  double JetPFETmax = 0.0;
3725  for ( unsigned i = 0; i < PFjets.size(); i++) {
3726  TLorentzVector jetmom = PFjets[i].GetMomentum();
3727  double jetpf_pt = sqrt(jetmom.Px()*jetmom.Px()+jetmom.Py()*jetmom.Py());
3728  double jetpf_et = jetmom.Et();
3729 
3731  jet.eta = jetmom.Eta();
3732  jet.phi = jetmom.Phi();
3733  jet.et = jetmom.Et();
3734  jet.e = jetmom.E();
3735 
3736  if(outEvent_) outEvent_->addJetPF( jet );
3737 
3738  if (tauBenchmarkDebug_) {
3739  cout <<" Rec jet : "<< PFjets[i] <<endl;
3740  cout << jetmom.Px() << " " << jetmom.Py() << " "
3741  << jetmom.Pz() << " " << jetmom.E()
3742  << " PT=" << jetpf_pt << " eta="<< jetmom.Eta()
3743  << " Phi=" << jetmom.Phi() << endl;
3744  cout << "------------------------------------------------" << endl;
3745  }//debug
3746 
3747  if (jetpf_et >= JetPFETmax)
3748  JetPFETmax = jetpf_et;
3749  }//loop PF jets
3750 
3751  //fill histos
3752 
3753  double deltaEtEHT = JetEHTETmax - partTOTMC.Et();
3754  h_deltaETvisible_MCEHT_->Fill(deltaEtEHT);
3755 
3756  double deltaEt = JetPFETmax - partTOTMC.Et();
3757  h_deltaETvisible_MCPF_ ->Fill(deltaEt);
3758 
3759  if (verbosity_ == VERBOSE ) {
3760  cout << "tau benchmark E_T(PF) - E_T(true) = " << deltaEt << endl;
3761  }
3762 
3763  return deltaEt/partTOTMC.Et();
3764 }//Makejets
CaloTowerCollection caloTowers_
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
bool tauBenchmarkDebug_
tau benchmark debug
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
#define abs(x)
Definition: mlp_lapack.h:159
void addJetMC(const Jet &jets)
Definition: EventColin.h:100
int pdgCode() const
Definition: PFSimParticle.h:35
const std::vector< PFJetAlgorithm::Jet > & FindJets(const std::vector< TLorentzVector > *vecs)
T eta() const
int ii
Definition: cuy.py:588
reco::PFSimParticleCollection trueParticles_
PFJetAlgorithm jetAlgo_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:25
T sqrt(T t)
Definition: SSEVec.h:48
TH1F * h_deltaETvisible_MCPF_
output histo dET ( PF - MC)
TH1F * h_deltaETvisible_MCEHT_
output histo dET ( EHT - MC)
true particle for particle flow
Definition: PFSimParticle.h:19
void addJetPF(const Jet &jets)
Definition: EventColin.h:108
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:35
virtual int charge() const GCC11_FINAL
electric charge
edm::HepMCProduct MCTruth_
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
size_type size() const
static TVector3 VectorEPRtoXYZ(const TVector3 &posepr)
converts a vector (in eta,phi,R) to a vector in (x,y,z)
Definition: Utils.cc:73
tuple cout
Definition: gather_cfg.py:121
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
int verbosity_
verbosity
void addJetEHT(const Jet &jets)
Definition: EventColin.h:104
virtual ParticleType particleId() const
Definition: PFCandidate.h:347
bool fastsim_
Fastsim or fullsim.
Definition: DDAxes.h:10
bool PFRootEventManager::trackInsideGCut ( const reco::PFTrack track) const

is PFTrack inside cut G ? yes if at least one trajectory point is inside.

Definition at line 4417 of file PFRootEventManager.cc.

References i, pos, and reco::PFTrack::trajectoryPoints().

Referenced by fillTrackMask(), and print().

4417  {
4418 
4419  TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
4420  if(!cutg) return true;
4421 
4422  const vector< reco::PFTrajectoryPoint >& points = track.trajectoryPoints();
4423 
4424  for( unsigned i=0; i<points.size(); i++) {
4425  if( ! points[i].isValid() ) continue;
4426 
4427  const math::XYZPoint& pos = points[i].position();
4428  if( cutg->IsInside( pos.Eta(), pos.Phi() ) ) return true;
4429  }
4430 
4431  // no point inside cut
4432  return false;
4433 }
int i
Definition: DBlmapReader.cc:9
const std::vector< reco::PFTrajectoryPoint > & trajectoryPoints() const
Definition: PFTrack.h:98
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
TTree* PFRootEventManager::tree ( )
inline

get tree

Definition at line 331 of file PFRootEventManager.h.

References tree_.

331 {return tree_;}
TTree * tree_
input tree
void PFRootEventManager::write ( void  )
virtual

Reimplemented in PFRootEventManagerColin, and MyPFRootEventManager.

Definition at line 1882 of file PFRootEventManager.cc.

References clusterAlgoECAL_, clusterAlgoHCAL_, clusterAlgoHFEM_, clusterAlgoHFHAD_, clusterAlgoHO_, clusterAlgoPS_, gather_cfg::cout, doPFDQM_, doPFJetBenchmark_, doPFMETBenchmark_, dqmFile_, metManager_, outFile_, PFJetBenchmark_, pfJetMonitor_, pfMETMonitor_, Benchmark::write(), PFJetBenchmark::write(), and PFClusterAlgo::write().

Referenced by PFRootEventManagerColin::write().

1882  {
1883 
1885  if(doPFMETBenchmark_) metManager_->write();
1892 
1893  // Addition to have DQM histograms : by S. Dutta
1894  if (doPFDQM_) {
1895  cout << " Writing DQM root file " << endl;
1896  pfJetMonitor_.write();
1897  pfMETMonitor_.write();
1898  dqmFile_->Write();
1899  }
1900  //-----------------------------------------------
1901  if(outFile_) {
1902  outFile_->Write();
1903 // outFile_->cd();
1904 // // write histos here
1905 // cout<<"writing output to "<<outFile_->GetName()<<endl;
1906 // h_deltaETvisible_MCEHT_->Write();
1907 // h_deltaETvisible_MCPF_->Write();
1908 // if(outTree_) outTree_->Write();
1909 // if(doPFCandidateBenchmark_) pfCandidateBenchmark_.write();
1910  }
1911 }
PFClusterAlgo clusterAlgoHFEM_
clustering algorithm for HF, electro-magnetic layer
PFMETMonitor pfMETMonitor_
PFClusterAlgo clusterAlgoHO_
clustering algorithm for HO
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.
PFClusterAlgo clusterAlgoECAL_
void write()
write to the TFile, in plain ROOT mode. No need to call this function in DQM mode ...
Definition: Benchmark.cc:99
bool doPFMETBenchmark_
PFMET benchmark on/off.
TFile * outFile_
output file
PFJetMonitor pfJetMonitor_
PFClusterAlgo clusterAlgoHCAL_
clustering algorithm for HCAL
void write()
write histos
PFClusterAlgo clusterAlgoPS_
clustering algorithm for PS
bool doPFJetBenchmark_
PFJet benchmark on/off.
std::auto_ptr< METManager > metManager_
tuple cout
Definition: gather_cfg.py:121
PFClusterAlgo clusterAlgoHFHAD_
clustering algorithm for HF, hadronic layer

Member Data Documentation

std::ofstream* PFRootEventManager::calibFile_

Definition at line 891 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

boost::shared_ptr<PFEnergyCalibration> PFRootEventManager::calibration_

Definition at line 888 of file PFRootEventManager.h.

Referenced by readOptions().

std::vector<ProtoJet> PFRootEventManager::caloJets_

calo Jets

Definition at line 635 of file PFRootEventManager.h.

Referenced by print(), and reconstructCaloJets().

std::vector<reco::CaloJet> PFRootEventManager::caloJetsCMSSW_

Definition at line 650 of file PFRootEventManager.h.

Referenced by processEntry(), readCMSSWJets(), and readFromSimulation().

edm::Handle< std::vector<reco::CaloJet> > PFRootEventManager::caloJetsHandle_

CMSSW calo Jets.

Definition at line 648 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::caloJetsTag_

Definition at line 649 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::CaloMETCollection PFRootEventManager::caloMets_

Calo MET.

Definition at line 661 of file PFRootEventManager.h.

reco::CaloMETCollection PFRootEventManager::caloMetsCMSSW_

Definition at line 669 of file PFRootEventManager.h.

Referenced by processEntry(), and readFromSimulation().

edm::Handle<reco::CaloMETCollection> PFRootEventManager::caloMetsHandle_

CMSSW Calo MET.

Definition at line 667 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::caloMetsTag_

Definition at line 668 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

CaloTowerCollection PFRootEventManager::caloTowers_

Definition at line 518 of file PFRootEventManager.h.

Referenced by readFromSimulation(), reconstructCaloJets(), and tauBenchmark().

edm::Handle<CaloTowerCollection> PFRootEventManager::caloTowersHandle_

input collection of calotowers

Definition at line 516 of file PFRootEventManager.h.

Referenced by readFromSimulation().

reco::CandidatePtrVector PFRootEventManager::caloTowersPtrs_

for the reconstruction of jets. The elements will point to the objects in caloTowers_ has to be global to have a lifetime = lifetime of PFJets

Definition at line 523 of file PFRootEventManager.h.

Referenced by reconstructCaloJets().

edm::InputTag PFRootEventManager::caloTowersTag_

Definition at line 517 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

PFClusterAlgo PFRootEventManager::clusterAlgoECAL_

clustering algorithm for ECAL

Definition at line 702 of file PFRootEventManager.h.

Referenced by clustering(), DisplayManager::createGRecHit(), DisplayManager::loadGRecHits(), print(), readOptions(), and write().

PFClusterAlgo PFRootEventManager::clusterAlgoHCAL_

clustering algorithm for HCAL

Definition at line 705 of file PFRootEventManager.h.

Referenced by clustering(), DisplayManager::createGRecHit(), DisplayManager::loadGRecHits(), print(), readOptions(), and write().

PFClusterAlgo PFRootEventManager::clusterAlgoHFEM_

clustering algorithm for HF, electro-magnetic layer

Definition at line 711 of file PFRootEventManager.h.

Referenced by clustering(), DisplayManager::createGRecHit(), DisplayManager::loadGRecHits(), print(), readOptions(), and write().

PFClusterAlgo PFRootEventManager::clusterAlgoHFHAD_

clustering algorithm for HF, hadronic layer

Definition at line 714 of file PFRootEventManager.h.

Referenced by clustering(), DisplayManager::createGRecHit(), DisplayManager::loadGRecHits(), print(), readOptions(), and write().

PFClusterAlgo PFRootEventManager::clusterAlgoHO_

clustering algorithm for HO

Definition at line 708 of file PFRootEventManager.h.

Referenced by clustering(), DisplayManager::loadGRecHits(), print(), readOptions(), and write().

PFClusterAlgo PFRootEventManager::clusterAlgoPS_

clustering algorithm for PS

Definition at line 717 of file PFRootEventManager.h.

Referenced by clustering(), DisplayManager::createGRecHit(), DisplayManager::loadGRecHits(), print(), readOptions(), and write().

boost::shared_ptr<pftools::PFClusterCalibration> PFRootEventManager::clusterCalibration_

particle data table.

Definition at line 887 of file PFRootEventManager.h.

std::auto_ptr< reco::PFClusterCollection > PFRootEventManager::clustersECAL_
edm::Handle<reco::PFClusterCollection> PFRootEventManager::clustersECALHandle_

clusters ECAL

Definition at line 486 of file PFRootEventManager.h.

edm::InputTag PFRootEventManager::clustersECALTag_

Definition at line 487 of file PFRootEventManager.h.

std::auto_ptr< reco::PFClusterCollection > PFRootEventManager::clustersHCAL_
edm::Handle<reco::PFClusterCollection> PFRootEventManager::clustersHCALHandle_

clusters HCAL

Definition at line 491 of file PFRootEventManager.h.

edm::InputTag PFRootEventManager::clustersHCALTag_

Definition at line 492 of file PFRootEventManager.h.

std::auto_ptr< reco::PFClusterCollection > PFRootEventManager::clustersHFEM_
edm::Handle<reco::PFClusterCollection> PFRootEventManager::clustersHFEMHandle_

clusters HCAL

Definition at line 501 of file PFRootEventManager.h.

edm::InputTag PFRootEventManager::clustersHFEMTag_

Definition at line 502 of file PFRootEventManager.h.

std::auto_ptr< reco::PFClusterCollection > PFRootEventManager::clustersHFHAD_
edm::Handle<reco::PFClusterCollection> PFRootEventManager::clustersHFHADHandle_

clusters HCAL

Definition at line 506 of file PFRootEventManager.h.

edm::InputTag PFRootEventManager::clustersHFHADTag_

Definition at line 507 of file PFRootEventManager.h.

std::auto_ptr< reco::PFClusterCollection > PFRootEventManager::clustersHO_
edm::Handle<reco::PFClusterCollection> PFRootEventManager::clustersHOHandle_

clusters HO

Definition at line 496 of file PFRootEventManager.h.

edm::InputTag PFRootEventManager::clustersHOTag_

Definition at line 497 of file PFRootEventManager.h.

std::auto_ptr< reco::PFClusterCollection > PFRootEventManager::clustersPS_
edm::Handle<reco::PFClusterCollection> PFRootEventManager::clustersPSHandle_

clusters PS

Definition at line 511 of file PFRootEventManager.h.

edm::InputTag PFRootEventManager::clustersPSTag_

Definition at line 512 of file PFRootEventManager.h.

reco::GsfPFRecTrackCollection PFRootEventManager::convBremGsfrecTracks_

Definition at line 552 of file PFRootEventManager.h.

Referenced by particleFlow(), processEntry(), and readFromSimulation().

edm::Handle<reco::GsfPFRecTrackCollection> PFRootEventManager::convBremGsfrecTracksHandle_

reconstructed secondary GSF tracks

Definition at line 550 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::convBremGsfrecTracksTag_

Definition at line 551 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::PFConversionCollection PFRootEventManager::conversion_

Definition at line 567 of file PFRootEventManager.h.

Referenced by particleFlow(), processEntry(), and readFromSimulation().

edm::Handle<reco::PFConversionCollection> PFRootEventManager::conversionHandle_

conversions

Definition at line 565 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::conversionTag_

Definition at line 566 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

std::vector<reco::CaloJet> PFRootEventManager::corrcaloJetsCMSSW_

Definition at line 655 of file PFRootEventManager.h.

Referenced by processEntry(), and readFromSimulation().

edm::Handle< std::vector<reco::CaloJet> > PFRootEventManager::corrcaloJetsHandle_

CMSSW corrected calo Jets.

Definition at line 653 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::corrcaloJetsTag_

Definition at line 654 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

bool PFRootEventManager::debug_

debug printouts for this PFRootEventManager on/off

Definition at line 836 of file PFRootEventManager.h.

Referenced by particleFlow(), and readOptions().

double PFRootEventManager::DeltaMETcut

Definition at line 733 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

double PFRootEventManager::DeltaPhicut

Definition at line 734 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

reco::PFRecTrackCollection PFRootEventManager::displacedRecTracks_

Definition at line 537 of file PFRootEventManager.h.

Referenced by particleFlow(), and readFromSimulation().

edm::Handle<reco::PFRecTrackCollection> PFRootEventManager::displacedRecTracksHandle_

Definition at line 533 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::displacedRecTracksTag_

Definition at line 535 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

bool PFRootEventManager::doClustering_

clustering on/off. If on, rechits from tree are used to form clusters. If off, clusters from tree are used.

Definition at line 800 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

bool PFRootEventManager::doCompare_

comparison with pf CMSSW

Definition at line 806 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

bool PFRootEventManager::doJets_

jets on/off

Definition at line 812 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

bool PFRootEventManager::doMet_

MET on/off.

Definition at line 815 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

bool PFRootEventManager::doParticleFlow_

particle flow on/off

Definition at line 803 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

bool PFRootEventManager::doPFCandidateBenchmark_

Definition at line 737 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

bool PFRootEventManager::doPFDQM_

Definition at line 749 of file PFRootEventManager.h.

Referenced by processEntry(), readOptions(), and write().

bool PFRootEventManager::doPFJetBenchmark_

PFJet benchmark on/off.

Definition at line 830 of file PFRootEventManager.h.

Referenced by processEntry(), readOptions(), and write().

bool PFRootEventManager::doPFMETBenchmark_

PFMET benchmark on/off.

Definition at line 833 of file PFRootEventManager.h.

Referenced by processEntry(), readOptions(), and write().

bool PFRootEventManager::doTauBenchmark_

tau benchmark on/off

Definition at line 824 of file PFRootEventManager.h.

Referenced by processEntry(), readFromSimulation(), and readOptions().

TFile* PFRootEventManager::dqmFile_

Definition at line 750 of file PFRootEventManager.h.

Referenced by readOptions(), and write().

reco::SuperClusterCollection PFRootEventManager::ebsc_

superclusters

Definition at line 575 of file PFRootEventManager.h.

Referenced by particleFlow().

reco::SuperClusterCollection PFRootEventManager::eesc_

Definition at line 576 of file PFRootEventManager.h.

Referenced by particleFlow().

edm::Handle<reco::GsfElectronCollection> PFRootEventManager::egammaElectronHandle_

Definition at line 545 of file PFRootEventManager.h.

Referenced by readFromSimulation().

reco::GsfElectronCollection PFRootEventManager::egammaElectrons_

Definition at line 547 of file PFRootEventManager.h.

Referenced by particleFlow(), and readFromSimulation().

edm::InputTag PFRootEventManager::egammaElectronsTag_

Definition at line 546 of file PFRootEventManager.h.

Referenced by readFromSimulation(), and readOptions().

fwlite::ChainEvent* PFRootEventManager::ev_
edm::EventAuxiliary* PFRootEventManager::eventAuxiliary_

event auxiliary information

Definition at line 447 of file PFRootEventManager.h.

TBranch* PFRootEventManager::eventAuxiliaryBranch_

Definition at line 444 of file PFRootEventManager.h.

bool PFRootEventManager::fastsim_

Fastsim or fullsim.

Definition at line 847 of file PFRootEventManager.h.

Referenced by readOptions(), and tauBenchmark().

TFile* PFRootEventManager::file_

input file

Definition at line 687 of file PFRootEventManager.h.

bool PFRootEventManager::filterHadronicTaus_

Definition at line 792 of file PFRootEventManager.h.

Referenced by readFromSimulation(), and readOptions().

unsigned PFRootEventManager::filterNParticles_

Definition at line 790 of file PFRootEventManager.h.

Referenced by readFromSimulation(), and readOptions().

std::vector<int> PFRootEventManager::filterTaus_

Definition at line 794 of file PFRootEventManager.h.

Referenced by countChargedAndPhotons(), readFromSimulation(), and readOptions().

bool PFRootEventManager::findRecHitNeighbours_

find rechit neighbours ?

Definition at line 839 of file PFRootEventManager.h.

Referenced by readFromSimulation(), and readOptions().

reco::GenJetCollection PFRootEventManager::genJets_

gen Jets

Definition at line 604 of file PFRootEventManager.h.

Referenced by print(), printMCCalib(), processEntry(), and reconstructGenJets().

reco::GenJetCollection PFRootEventManager::genJetsCMSSW_

Definition at line 645 of file PFRootEventManager.h.

Referenced by readCMSSWJets(), and readFromSimulation().

edm::Handle<reco::GenJetCollection> PFRootEventManager::genJetsHandle_

CMSSW gen Jets.

Definition at line 643 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::genJetsTag_

Definition at line 644 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::GenParticleCollection PFRootEventManager::genParticlesCMSSW_

Definition at line 609 of file PFRootEventManager.h.

Referenced by processEntry(), and readFromSimulation().

reco::GenParticleRefVector PFRootEventManager::genParticlesforJets_

Definition at line 601 of file PFRootEventManager.h.

Referenced by readFromSimulation(), and reconstructGenJets().

edm::Handle<reco::GenParticleRefVector> PFRootEventManager::genParticlesforJetsHandle_

input collection of gen particles

Definition at line 599 of file PFRootEventManager.h.

Referenced by readFromSimulation().

reco::CandidatePtrVector PFRootEventManager::genParticlesforJetsPtrs_

gen particle base candidates (input for gen jets new since 1_8_0) the vector of references to genParticles genParticlesforJets_ is converted to a PtrVector, which is the input to jet reco

Definition at line 614 of file PFRootEventManager.h.

Referenced by reconstructGenJets().

edm::InputTag PFRootEventManager::genParticlesforJetsTag_

Definition at line 600 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

edm::Handle<reco::GenParticleCollection> PFRootEventManager::genParticlesforMETHandle_

CMSSW GenParticles.

Definition at line 607 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::genParticlesforMETTag_

Definition at line 608 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::GsfPFRecTrackCollection PFRootEventManager::gsfrecTracks_
edm::Handle<reco::GsfPFRecTrackCollection> PFRootEventManager::gsfrecTracksHandle_

reconstructed GSF tracks

Definition at line 540 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::gsfrecTracksTag_

Definition at line 541 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

TH1F* PFRootEventManager::h_deltaETvisible_MCEHT_

output histo dET ( EHT - MC)

Definition at line 435 of file PFRootEventManager.h.

Referenced by PFRootEventManager(), and tauBenchmark().

TH1F* PFRootEventManager::h_deltaETvisible_MCPF_

output histo dET ( PF - MC)

Definition at line 438 of file PFRootEventManager.h.

Referenced by PFRootEventManager(), and tauBenchmark().

int PFRootEventManager::iEvent_

current event

Definition at line 416 of file PFRootEventManager.h.

Referenced by eventNumber(), and processEntry().

std::vector<std::string> PFRootEventManager::inFileNames_

input file names

Definition at line 690 of file PFRootEventManager.h.

Referenced by connect().

bool PFRootEventManager::JECinCaloMet_

propagate the Jet Energy Corrections to the caloMET on/off

Definition at line 818 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

PFJetAlgorithm PFRootEventManager::jetAlgo_

native jet algorithm

Definition at line 741 of file PFRootEventManager.h.

Referenced by readOptions(), and tauBenchmark().

int PFRootEventManager::jetAlgoType_

jet algo type

Definition at line 821 of file PFRootEventManager.h.

Referenced by readOptions(), and reconstructFWLiteJets().

FWLiteJetProducer PFRootEventManager::jetMaker_

wrapper to official jet algorithms

Definition at line 744 of file PFRootEventManager.h.

Referenced by readOptions(), and reconstructFWLiteJets().

bool PFRootEventManager::jetsDebug_

debug printouts for jet algo on/off

Definition at line 843 of file PFRootEventManager.h.

Referenced by readOptions(), reconstructCaloJets(), reconstructGenJets(), and reconstructPFJets().

RunsMap PFRootEventManager::mapEventToEntry_

Definition at line 898 of file PFRootEventManager.h.

Referenced by eventToEntry(), and initializeEventInformation().

edm::HepMCProduct PFRootEventManager::MCTruth_
edm::Handle<edm::HepMCProduct> PFRootEventManager::MCTruthHandle_

MC truth.

Definition at line 594 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::MCTruthTag_

Definition at line 595 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

double PFRootEventManager::MET1cut

PFMET Benchmark.

Definition at line 732 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

std::auto_ptr<METManager> PFRootEventManager::metManager_

Definition at line 893 of file PFRootEventManager.h.

Referenced by processEntry(), readOptions(), and write().

reco::MuonCollection PFRootEventManager::muons_

Definition at line 562 of file PFRootEventManager.h.

Referenced by particleFlow(), processEntry(), and readFromSimulation().

edm::Handle<reco::MuonCollection> PFRootEventManager::muonsHandle_

muons

Definition at line 560 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::muonsTag_

Definition at line 561 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

IO* PFRootEventManager::options_
EventColin* PFRootEventManager::outEvent_
TFile* PFRootEventManager::outFile_
std::string PFRootEventManager::outFileName_

output filename

Definition at line 696 of file PFRootEventManager.h.

TTree* PFRootEventManager::outTree_

output tree

Definition at line 428 of file PFRootEventManager.h.

Referenced by processEntry(), readOptions(), and reset().

PFAlgo PFRootEventManager::pfAlgo_

particle flow algorithm

Definition at line 724 of file PFRootEventManager.h.

Referenced by particleFlow(), and readOptions().

PFBlockAlgo PFRootEventManager::pfBlockAlgo_

algorithm for building the particle flow blocks

Definition at line 721 of file PFRootEventManager.h.

Referenced by particleFlow(), and readOptions().

std::auto_ptr< reco::PFBlockCollection > PFRootEventManager::pfBlocks_
reco::PFCandidateCollection PFRootEventManager::pfCandCMSSW_

Definition at line 684 of file PFRootEventManager.h.

Referenced by pfCandCompare(), and readFromSimulation().

std::auto_ptr< reco::PFCandidateElectronExtraCollection > PFRootEventManager::pfCandidateElectronExtras_

PFCandidateElectronExtra.

Definition at line 623 of file PFRootEventManager.h.

Referenced by particleFlow().

edm::Handle<reco::PFCandidateCollection> PFRootEventManager::pfCandidateHandle_

CMSSW PF candidates.

Definition at line 682 of file PFRootEventManager.h.

Referenced by readFromSimulation().

PFCandidateManager PFRootEventManager::pfCandidateManager_

Definition at line 736 of file PFRootEventManager.h.

Referenced by processEntry(), and readOptions().

std::auto_ptr< reco::PFCandidateCollection > PFRootEventManager::pfCandidates_

reconstructed pfCandidates

Definition at line 620 of file PFRootEventManager.h.

Referenced by highPtPFCandidate(), particleFlow(), pfCandCompare(), print(), processEntry(), and reconstructPFJets().

reco::CandidatePtrVector PFRootEventManager::pfCandidatesPtrs_

for the reconstruction of jets. The elements will point to the objects in pfCandidates_ has to be global to have a lifetime = lifetime of PFJets TODO make the other candidate PtrVectors for jets global as well

Definition at line 629 of file PFRootEventManager.h.

Referenced by reconstructPFJets().

edm::InputTag PFRootEventManager::pfCandidateTag_

Definition at line 683 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

PFJetBenchmark PFRootEventManager::PFJetBenchmark_

PFJet Benchmark.

Definition at line 729 of file PFRootEventManager.h.

Referenced by processEntry(), readOptions(), and write().

PFJetMonitor PFRootEventManager::pfJetMonitor_

Definition at line 747 of file PFRootEventManager.h.

Referenced by processEntry(), readOptions(), and write().

reco::PFJetCollection PFRootEventManager::pfJets_

PF Jets.

Definition at line 632 of file PFRootEventManager.h.

Referenced by highPtJet(), print(), printMCCalib(), processEntry(), and reconstructPFJets().

reco::PFJetCollection PFRootEventManager::pfJetsCMSSW_

Definition at line 640 of file PFRootEventManager.h.

Referenced by readCMSSWJets(), and readFromSimulation().

edm::Handle<reco::PFJetCollection> PFRootEventManager::pfJetsHandle_

CMSSW PF Jets.

Definition at line 638 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::pfJetsTag_

Definition at line 639 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

PFMETMonitor PFRootEventManager::pfMETMonitor_

Definition at line 748 of file PFRootEventManager.h.

Referenced by processEntry(), readOptions(), and write().

reco::PFMETCollection PFRootEventManager::pfMets_

PF MET.

Definition at line 658 of file PFRootEventManager.h.

reco::PFMETCollection PFRootEventManager::pfMetsCMSSW_

Definition at line 679 of file PFRootEventManager.h.

Referenced by processEntry(), and readFromSimulation().

edm::Handle<reco::PFMETCollection> PFRootEventManager::pfMetsHandle_

CMSSW PF MET.

Definition at line 677 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::pfMetsTag_

Definition at line 678 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::PFDisplacedTrackerVertexCollection PFRootEventManager::pfNuclearTrackerVertex_

Definition at line 586 of file PFRootEventManager.h.

Referenced by particleFlow(), processEntry(), and readFromSimulation().

edm::Handle<reco::PFDisplacedTrackerVertexCollection> PFRootEventManager::pfNuclearTrackerVertexHandle_

PFDisplacedVertex.

Definition at line 584 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::pfNuclearTrackerVertexTag_

Definition at line 585 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

edm::Handle<reco::PhotonCollection> PFRootEventManager::photonHandle_

photons

Definition at line 570 of file PFRootEventManager.h.

Referenced by readFromSimulation().

reco::PhotonCollection PFRootEventManager::photons_

Definition at line 572 of file PFRootEventManager.h.

Referenced by particleFlow(), and readFromSimulation().

edm::InputTag PFRootEventManager::photonTag_

Definition at line 571 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::VertexCollection PFRootEventManager::primaryVertices_

Definition at line 529 of file PFRootEventManager.h.

Referenced by particleFlow(), processEntry(), and readFromSimulation().

edm::Handle<reco::VertexCollection> PFRootEventManager::primaryVerticesHandle_

reconstructed primary vertices

Definition at line 527 of file PFRootEventManager.h.

Referenced by particleFlow(), and readFromSimulation().

edm::InputTag PFRootEventManager::primaryVerticesTag_

Definition at line 528 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

bool PFRootEventManager::printClusters_

print clusters yes/no

Definition at line 760 of file PFRootEventManager.h.

Referenced by DialogFrame::createCmdFrame(), print(), readOptions(), and DialogFrame::selectPrintOption().

double PFRootEventManager::printClustersEMin_

Definition at line 761 of file PFRootEventManager.h.

Referenced by printCluster(), and readOptions().

bool PFRootEventManager::printGenParticles_
double PFRootEventManager::printGenParticlesPtMin_

Definition at line 780 of file PFRootEventManager.h.

Referenced by printGenParticles(), and readOptions().

bool PFRootEventManager::printMCTruthMatching_

Definition at line 783 of file PFRootEventManager.h.

Referenced by print(), and readOptions().

bool PFRootEventManager::printPFBlocks_

print PFBlocks yes/no

Definition at line 764 of file PFRootEventManager.h.

Referenced by DialogFrame::createCmdFrame(), print(), readOptions(), and DialogFrame::selectPrintOption().

bool PFRootEventManager::printPFCandidates_

print PFCandidates yes/no

Definition at line 767 of file PFRootEventManager.h.

Referenced by DialogFrame::createCmdFrame(), print(), readOptions(), and DialogFrame::selectPrintOption().

double PFRootEventManager::printPFCandidatesPtMin_

Definition at line 768 of file PFRootEventManager.h.

Referenced by print(), and readOptions().

bool PFRootEventManager::printPFJets_

print PFJets yes/no

Definition at line 771 of file PFRootEventManager.h.

Referenced by DialogFrame::createCmdFrame(), print(), readOptions(), and DialogFrame::selectPrintOption().

double PFRootEventManager::printPFJetsPtMin_

Definition at line 772 of file PFRootEventManager.h.

Referenced by print(), and readOptions().

bool PFRootEventManager::printRecHits_

print rechits yes/no

Definition at line 756 of file PFRootEventManager.h.

Referenced by DialogFrame::createCmdFrame(), print(), readOptions(), and DialogFrame::selectPrintOption().

double PFRootEventManager::printRecHitsEMin_

Definition at line 757 of file PFRootEventManager.h.

Referenced by printRecHit(), and readOptions().

bool PFRootEventManager::printSimParticles_

print true particles yes/no

Definition at line 775 of file PFRootEventManager.h.

Referenced by DialogFrame::createCmdFrame(), print(), readOptions(), and DialogFrame::selectPrintOption().

double PFRootEventManager::printSimParticlesPtMin_

Definition at line 776 of file PFRootEventManager.h.

Referenced by print(), and readOptions().

reco::PFRecHitCollection PFRootEventManager::rechitsCLEANED_

Definition at line 478 of file PFRootEventManager.h.

Referenced by particleFlow(), processEntry(), and readFromSimulation().

std::vector< edm::Handle<reco::PFRecHitCollection> > PFRootEventManager::rechitsCLEANEDHandles_

Definition at line 476 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

std::vector< edm::InputTag > PFRootEventManager::rechitsCLEANEDTags_

Definition at line 477 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

std::vector< reco::PFRecHitCollection > PFRootEventManager::rechitsCLEANEDV_

rechits HF CLEANED

Definition at line 475 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::PFRecHitCollection PFRootEventManager::rechitsECAL_
edm::Handle<reco::PFRecHitCollection> PFRootEventManager::rechitsECALHandle_

rechits ECAL

Definition at line 450 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::rechitsECALTag_

Definition at line 451 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::PFRecHitCollection PFRootEventManager::rechitsHCAL_
edm::Handle<reco::PFRecHitCollection> PFRootEventManager::rechitsHCALHandle_

rechits HCAL

Definition at line 455 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::rechitsHCALTag_

Definition at line 456 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::PFRecHitCollection PFRootEventManager::rechitsHFEM_
edm::Handle<reco::PFRecHitCollection> PFRootEventManager::rechitsHFEMHandle_

rechits HF EM

Definition at line 465 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::rechitsHFEMTag_

Definition at line 466 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::PFRecHitCollection PFRootEventManager::rechitsHFHAD_
edm::Handle<reco::PFRecHitCollection> PFRootEventManager::rechitsHFHADHandle_

rechits HF HAD

Definition at line 470 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::rechitsHFHADTag_

Definition at line 471 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::PFRecHitCollection PFRootEventManager::rechitsHO_
edm::Handle<reco::PFRecHitCollection> PFRootEventManager::rechitsHOHandle_

rechits HO

Definition at line 460 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::rechitsHOTag_

Definition at line 461 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::PFRecHitCollection PFRootEventManager::rechitsPS_
edm::Handle<reco::PFRecHitCollection> PFRootEventManager::rechitsPSHandle_

rechits PS

Definition at line 481 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::rechitsPSTag_

Definition at line 482 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::PFRecTrackCollection PFRootEventManager::recTracks_
edm::Handle<reco::PFRecTrackCollection> PFRootEventManager::recTracksHandle_

reconstructed tracks

Definition at line 532 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::recTracksTag_

Definition at line 534 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::TrackCollection PFRootEventManager::stdTracks_

Definition at line 557 of file PFRootEventManager.h.

Referenced by processEntry(), and readFromSimulation().

edm::Handle<reco::TrackCollection> PFRootEventManager::stdTracksHandle_

standard reconstructed tracks

Definition at line 555 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::stdTracksTag_

Definition at line 556 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

bool PFRootEventManager::tauBenchmarkDebug_

tau benchmark debug

Definition at line 827 of file PFRootEventManager.h.

Referenced by readOptions(), and tauBenchmark().

reco::METCollection PFRootEventManager::tcMets_

TCMET.

Definition at line 664 of file PFRootEventManager.h.

reco::METCollection PFRootEventManager::tcMetsCMSSW_

Definition at line 674 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::Handle<reco::METCollection> PFRootEventManager::tcMetsHandle_

CMSSW TCMET.

Definition at line 672 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::tcMetsTag_

Definition at line 673 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

boost::shared_ptr<PFEnergyCalibrationHF> PFRootEventManager::thepfEnergyCalibrationHF_

Definition at line 889 of file PFRootEventManager.h.

Referenced by readOptions().

TTree* PFRootEventManager::tree_

input tree

Definition at line 425 of file PFRootEventManager.h.

Referenced by tree().

reco::PFSimParticleCollection PFRootEventManager::trueParticles_
edm::Handle<reco::PFSimParticleCollection> PFRootEventManager::trueParticlesHandle_

true particles

Definition at line 589 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::trueParticlesTag_

Definition at line 590 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

bool PFRootEventManager::useAtHLT_

Use HLT tracking.

Definition at line 874 of file PFRootEventManager.h.

Referenced by particleFlow(), and readOptions().

bool PFRootEventManager::useConvBremGsfTracks_

Use Secondary Gsf Tracks.

Definition at line 859 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

bool PFRootEventManager::useConvBremPFRecTracks_

Use Conv Brem KF Tracks.

Definition at line 862 of file PFRootEventManager.h.

Referenced by connect(), and readOptions().

bool PFRootEventManager::useEGElectrons_

Use EGElectrons.

Definition at line 871 of file PFRootEventManager.h.

Referenced by particleFlow(), readFromSimulation(), and readOptions().

bool PFRootEventManager::useEGPhotons_

Use EGPhotons.

Definition at line 865 of file PFRootEventManager.h.

Referenced by readFromSimulation(), and readOptions().

bool PFRootEventManager::useHO_

Use of HO in links with tracks/HCAL and in particle flow reconstruction.

Definition at line 877 of file PFRootEventManager.h.

Referenced by clustering(), fillOutEventWithClusters(), particleFlow(), print(), processEntry(), readFromSimulation(), and readOptions().

bool PFRootEventManager::useKDTreeTrackEcalLinker_

ECAL-track link optimization.

Definition at line 809 of file PFRootEventManager.h.

Referenced by readOptions().

bool PFRootEventManager::usePFConversions_

Use of conversions in PFAlgo.

Definition at line 850 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

bool PFRootEventManager::usePFElectrons_

Use PFElectrons.

Definition at line 868 of file PFRootEventManager.h.

Referenced by particleFlow(), and readOptions().

bool PFRootEventManager::usePFNuclearInteractions_

Use of PFDisplacedVertex in PFAlgo.

Definition at line 856 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

bool PFRootEventManager::usePFV0s_

Use of V0 in PFAlgo.

Definition at line 853 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

reco::PFV0Collection PFRootEventManager::v0_

Definition at line 581 of file PFRootEventManager.h.

Referenced by particleFlow(), processEntry(), and readFromSimulation().

edm::Handle<reco::PFV0Collection> PFRootEventManager::v0Handle_

V0.

Definition at line 579 of file PFRootEventManager.h.

Referenced by readFromSimulation().

edm::InputTag PFRootEventManager::v0Tag_

Definition at line 580 of file PFRootEventManager.h.

Referenced by connect(), and readFromSimulation().

int PFRootEventManager::verbosity_