7 Processor(
"TJjetsPFOAnalysisProcessor"),
14 m_lookForQuarksWithMotherZ(0),
15 m_mcPfoSelectionRadius(500.f),
16 m_mcPfoSelectionMomentum(0.01f),
17 m_mcPfoSelectionLowEnergyNPCutOff(1.2f),
19 m_nPfosNeutralHadrons(0),
22 m_pfoEnergyTotal(0.f),
23 m_pfoEnergyNeutralHadrons(0.f),
24 m_pfoEnergyPhotons(0.f),
25 m_pfoEnergyTracks(0.f),
26 m_pfoECalToEmEnergy(0.f),
27 m_pfoECalToHadEnergy(0.f),
28 m_pfoHCalToEmEnergy(0.f),
29 m_pfoHCalToHadEnergy(0.f),
30 m_pfoMuonToEnergy(0.f),
31 m_pfoOtherEnergy(0.f),
33 m_nPfoTargetsTotal(0),
34 m_nPfoTargetsNeutralHadrons(0),
35 m_nPfoTargetsPhotons(0),
36 m_nPfoTargetsTracks(0),
37 m_pfoTargetsEnergyTotal(0.f),
38 m_pfoTargetsEnergyNeutralHadrons(0.f),
39 m_pfoTargetsEnergyPhotons(0.f),
40 m_pfoTargetsEnergyTracks(0.f),
54 m_hPfoEnergySum(NULL),
55 m_hPfoEnergySumL7A(NULL)
57 _description =
"TJjetsPFOAnalysisProcessor: Basically a copy-pasted version of the PFOAnalysis processor working on individual TrueJet jets" ;
63 registerInputCollection( LCIO::RECONSTRUCTEDPARTICLE,
64 "InputAllPFOsCollection",
65 "Name of the PFOs collection",
67 std::string(
"PandoraPFOs")
70 registerInputCollection( LCIO::MCPARTICLE,
71 "MCParticleCollection",
72 "Name of the MC particle collection",
74 std::string(
"MCParticle")
80 registerInputCollection( LCIO::LCRELATION,
82 "Name of the RecoMCTruthLink input collection" ,
84 std::string(
"RecoMCTruthLink") ) ;
86 registerInputCollection( LCIO::RECONSTRUCTEDPARTICLE,
88 "Name of the TrueJetCollection output collection" ,
89 _trueJetCollectionName ,
90 std::string(
"TrueJets") ) ;
92 registerInputCollection( LCIO::RECONSTRUCTEDPARTICLE,
93 "FinalColourNeutrals" ,
94 "Name of the FinalColourNeutralCollection output collection" ,
95 _finalColourNeutralCollectionName ,
96 std::string(
"FinalColourNeutrals") ) ;
98 registerInputCollection( LCIO::RECONSTRUCTEDPARTICLE,
99 "InitialColourNeutrals" ,
100 "Name of the InitialColourNeutralCollection output collection" ,
101 _initialColourNeutralCollectionName ,
102 std::string(
"InitialColourNeutrals") ) ;
104 registerInputCollection( LCIO::LCRELATION,
106 "Name of the TrueJetPFOLink output collection" ,
108 std::string(
"TrueJetPFOLink") ) ;
110 registerInputCollection( LCIO::LCRELATION,
111 "TrueJetMCParticleLink" ,
112 "Name of the TrueJetMCParticleLink output collection" ,
113 _trueJetMCParticleLink,
114 std::string(
"TrueJetMCParticleLink") ) ;
116 registerInputCollection( LCIO::LCRELATION,
117 "FinalElementonLink" ,
118 "Name of the FinalElementonLink output collection" ,
120 std::string(
"FinalElementonLink") ) ;
122 registerInputCollection( LCIO::LCRELATION,
123 "InitialElementonLink" ,
124 "Name of the InitialElementonLink output collection" ,
125 _initialElementonLink,
126 std::string(
"InitialElementonLink") ) ;
128 registerInputCollection( LCIO::LCRELATION,
129 "FinalColourNeutralLink" ,
130 "Name of the FinalColourNeutralLink output collection" ,
131 _finalColourNeutralLink,
132 std::string(
"FinalColourNeutralLink") ) ;
134 registerInputCollection( LCIO::LCRELATION,
135 "InitialColourNeutralLink" ,
136 "Name of the InitialColourNeutralLink output collection" ,
137 _initialColourNeutralLink,
138 std::string(
"InitialColourNeutralLink") ) ;
144 registerProcessorParameter(
145 "LookForQuarksWithMotherZ",
146 "Flag to look for quarks with mother Z",
150 registerProcessorParameter(
151 "MCPfoSelectionRadius",
152 "MC pfo selection radius",
156 registerProcessorParameter(
157 "MCPfoSelectionMomentum",
158 "MC pfo selection momentum",
162 registerProcessorParameter(
163 "MCPfoSelectionLowEnergyNPCutOff",
164 "MC pfo selection neutron and proton low energy cut-off",
168 registerProcessorParameter(
170 "Name of the output root file",
172 std::string(
"PFOAnalysis.root"));
179 streamlog_out(DEBUG) <<
" init called " << std::endl ;
196 m_pTTree =
new TTree(
"PfoAnalysisTree",
"PfoAnalysisTree");
252 m_hPfoEnergySum =
new TH1F(
"fPFA",
"total pfo energy", 10000, 0., 5000.);
253 m_hPfoEnergySumL7A =
new TH1F(
"fPFA_L7A",
"total pfo energy < 0.7 A", 10000, 0., 5000.);
278 m_nRun =
event->getRunNumber();
279 m_nEvt =
event->getEventNumber();
283 std::cout <<
" processed events: " <<
m_nEvtSum << std::endl;
288 for (
int i_jet=0; i_jet<njets(); i_jet++) {
292 if( initial_elementon(i_jet) != NULL) {
297 if( final_elementon(i_jet) != NULL) {
324 std::cout <<
"PfoAnalysis::end() " << this->name() <<
" processed " <<
m_nEvtSum <<
" events in " <<
m_nRunSum <<
" runs " << std::endl
325 <<
"Rootfile: " <<
m_rootFile.c_str() << std::endl;
FloatVector m_pfoTargetEnergies
FloatVector m_pfoEnergies
float m_mcPfoSelectionMomentum
TJjetsPFOAnalysisProcessor aTJjetsPFOAnalysisProcessor
std::string _recoMCTruthLink
void MakeQuarkVariables(JetContentPair *jet_content)
Make quark variables.
float m_pfoHCalToHadEnergy
float m_mcPfoSelectionLowEnergyNPCutOff
float m_pfoTargetsEnergyTracks
float m_pfoEnergyNeutralHadrons
float m_pfoECalToEmEnergy
void end()
Called after data processing for clean up.
int m_nPfoTargetsNeutralHadrons
int m_lookForQuarksWithMotherZ
std::string _colAllPFOs
Input collection name.
TJjetsPFOAnalysisProcessor()
FloatVector m_pfoCosTheta
void check(LCEvent *event)
float m_pfoHCalToEmEnergy
FloatVector m_pfoTargetPx
void init()
Called at the begin of the job before anything is read.
float m_pfoTargetsEnergyNeutralHadrons
FloatVector m_pfoTargetPz
void processRunHeader(LCRunHeader *run)
Called for every run.
IntVector m_pfoTargetPdgCodes
float m_pfoTargetsEnergyPhotons
void findTrueJetParticles(LCEvent *event)
void PerformPfoAnalysis()
Perform pfo analysis.
void ExtractCollections(JetContentPair *jet_content)
Extract lcio collections.
void Clear()
PFOAnalysis stuff.
int m_nPfosNeutralHadrons
TH1F * m_hPfoEnergySumL7A
float m_pfoTargetsEnergyTotal
FloatVector m_pfoTargetCosTheta
float m_pfoECalToHadEnergy
FloatVector m_pfoTargetPy
void processEvent(LCEvent *event)
Called for every event - the working horse.
float m_mcPfoSelectionRadius