#include <AtlfastProtoJetMaker.h>
Collaboration diagram for Atlfast::AtlfastProtoJetMaker:
Public Member Functions | |
AtlfastProtoJetMaker (const std::string &name, ISvcLocator *pSvcLocator) | |
~AtlfastProtoJetMaker () | |
StatusCode | initialize () |
StatusCode | execute () |
StatusCode | finalize () |
Private Member Functions | |
template<class T1, class T2> | |
StatusCode | FillProtoJets (const std::vector< T1 * > &, T2 *, const std::string &) |
template<class T1, class T2> | |
StatusCode | FillProtoJets (const std::vector< T1 * > &, T2 *, const std::string &, bool) |
template<class T1, class T2> | |
StatusCode | FillProtoJets (const std::vector< T1 * > &, T2 *) |
Private Attributes | |
std::string | m_inputCellLocation |
std::string | m_inputClusterLocation |
std::string | m_outputTowerPJKey |
std::string | m_outputClusterPJKey |
std::string | m_outputFinalStatePJKey |
TesIO * | m_tesIO |
bool | m_towerPJConstruct |
bool | m_clusterPJConstruct |
bool | m_finalStatePJConstruct |
bool | m_towerPJSmearOn |
bool | m_clusterPJSmearOn |
std::string | m_mcLocation |
ISmearer * | m_smearer |
This Algorithm constructs AtlfastProtoJets from Cells, Clusters and final state particles. It stores them in the TES via StoreGate.
Definition at line 38 of file AtlfastProtoJetMaker.h.
Atlfast::AtlfastProtoJetMaker::AtlfastProtoJetMaker | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Standard Athena-Algorithm Constructor
Definition at line 40 of file AtlfastProtoJetMaker.cxx.
00040 : 00041 Algorithm(name,pSvcLocator){ 00042 00043 //default paths for entities in the TES 00044 m_inputCellLocation = "/Event/AtlfastCells"; 00045 m_inputClusterLocation = "/Event/AtlfastClusters"; 00046 00047 m_outputTowerPJKey = "/Event/AtlfastTowerProtoJets"; 00048 m_outputClusterPJKey = "/Event/AtlfastClusterProtoJets"; 00049 m_outputFinalStatePJKey = "/Event/AtlfastFinalStateProtoJets"; 00050 00051 00052 m_towerPJConstruct = true; 00053 m_clusterPJConstruct = true; 00054 m_finalStatePJConstruct = true; 00055 00056 m_towerPJSmearOn = false; 00057 m_clusterPJSmearOn = false; 00058 00059 declareProperty("InputCellLocation", m_inputCellLocation); 00060 declareProperty("InputClusterLocation", m_inputClusterLocation); 00061 00062 declareProperty("OutputTowerPJKey", m_outputTowerPJKey); 00063 declareProperty("OutputClusterPJKey", m_outputClusterPJKey); 00064 declareProperty("OutputFinalStatePJKey", m_outputFinalStatePJKey); 00065 00066 declareProperty("TowerPJConstruct", m_towerPJConstruct); 00067 declareProperty("ClusterPJConstruct", m_clusterPJConstruct); 00068 declareProperty("FinalStatePJConstruct", m_finalStatePJConstruct); 00069 00070 declareProperty("TowerPJSmearOn", m_towerPJSmearOn); 00071 declareProperty("ClusterPJSmearOn", m_clusterPJSmearOn); 00072 }
Atlfast::AtlfastProtoJetMaker::~AtlfastProtoJetMaker | ( | ) |
Default Destructor
Definition at line 75 of file AtlfastProtoJetMaker.cxx.
00076 { 00077 MsgStream log( messageService(), name() ) ; 00078 log << MSG::INFO << "AtlfastProtoJetMaker destructor called" << endreq; 00079 }
StatusCode Atlfast::AtlfastProtoJetMaker::initialize | ( | ) |
standard Athena-Algorithm method
Definition at line 81 of file AtlfastProtoJetMaker.cxx.
00082 { 00083 00084 MsgStream log( messageService(), name() ); 00085 log << MSG::DEBUG <<"AtlfastProtoJetllMaker initialize()" << endreq; 00086 //get the Global Event Data using singleton pattern 00087 GlobalEventData* ged = GlobalEventData::Instance(); 00088 00089 int lumi = ged->lumi(); 00090 int randSeed = ged->randSeed() ; 00091 double barrelForwardEta = ged->barrelForwardEta(); 00092 m_mcLocation = ged->mcLocation(); 00093 m_tesIO = new TesIO(m_mcLocation, ged->justHardScatter()); 00094 00095 m_smearer = new JetSmearer(randSeed, 00096 lumi, 00097 0., 00098 0., 00099 barrelForwardEta); 00100 00101 HeaderPrinter hp("Atlfast-ProtoJet Maker:", log); 00102 hp.add("Input Cell Key ", m_inputCellLocation); 00103 hp.add("Input Cluster Key ", m_inputClusterLocation); 00104 hp.add("Output Tower PJ Key ", m_outputTowerPJKey); 00105 hp.add("Output Cluster PJ Key ", m_outputClusterPJKey); 00106 hp.add("Output FinalState PJ Key ", m_outputFinalStatePJKey); 00107 hp.add("Construct Tower ProtoJets ", m_towerPJConstruct); 00108 hp.add("Construct Cluster ProtoJets ", m_clusterPJConstruct); 00109 hp.add("Construct Final State ProtoJets ", m_finalStatePJConstruct); 00110 hp.add("Smear Tower ProtoJets ", m_towerPJSmearOn); 00111 hp.add("Smear Cluster ProtoJets ", m_clusterPJSmearOn); 00112 hp.print(); 00113 00114 00115 return StatusCode::SUCCESS; 00116 }
StatusCode Atlfast::AtlfastProtoJetMaker::execute | ( | ) |
standard Athena-Algorithm method
get'em back std::vector<ProtoJet*> afpj; TesIoStat stat = m_tesIO->copy(afpj,m_outputTowerPJKey); message = stat? "Found Tower PJs in TES":"No Tower PJs in TES"; log<<MSG::DEBUG << message <<endreq; if(stat){ std::vector<ProtoJet*>::const_iterator itr = afpj.begin(); for (; itr != afpj.end(); ++itr) { log<<MSG::DEBUG << "the PJ ex" << (*itr)->ex() << endreq; log<<MSG::DEBUG << "the PJ ey" << (*itr)->ey() << endreq; log<<MSG::DEBUG << "the PJ ez" << (*itr)->ez() << endreq;; } }
Definition at line 126 of file AtlfastProtoJetMaker.cxx.
00127 { 00128 //............................................. 00129 00130 MsgStream log( messageService(), name() ); 00131 std::string message; 00132 log << MSG::DEBUG << "AtlfastProtoJetMaker execute()" << endreq; 00133 00134 AtlfastProtoJet* proJ; 00135 //do protojet filling from now on--------------------- 00136 if(m_towerPJConstruct){ 00137 //Get the cells from storeGate 00138 std::vector<const ICell*> cells; 00139 TesIoStat stat = 00140 m_tesIO->copy<ITwoCptCellCollection>(cells,m_inputCellLocation); 00141 message = stat? "Found Cells in TES":"No Cells in TES"; 00142 log<<MSG::DEBUG << message <<endreq; 00143 if(stat){ 00144 if(!this->FillProtoJets(cells,proJ,m_outputTowerPJKey,m_towerPJSmearOn)){ 00145 return StatusCode::FAILURE; 00146 } 00147 } 00148 } 00149 00150 if(m_clusterPJConstruct){ 00151 //Get the clusters from storeGate 00152 std::vector<ICluster*> clusters; 00153 TesIoStat stat = 00154 m_tesIO->copy<IClusterCollection>(clusters,m_inputClusterLocation); 00155 message = stat? "Found Clusters in TES":"No Clusters in TES"; 00156 log<<MSG::DEBUG << message <<endreq; 00157 if(stat){ 00158 if(!this->FillProtoJets(clusters,proJ,m_outputClusterPJKey,m_clusterPJSmearOn)){ 00159 return StatusCode::FAILURE; 00160 } 00161 } 00162 } 00163 if(m_finalStatePJConstruct){ 00164 //Get the FinalStateParticles from storeGate 00165 HepMC_helper::IsFinalState ifs; 00166 MCparticleCollection particles; 00167 TesIoStat stat = m_tesIO->getMC(particles, &ifs); 00168 message = stat? "Found FS Particles in TES":"No FS Particles in TES"; 00169 log<<MSG::DEBUG << message <<endreq; 00170 if(stat){ 00171 if(!this->FillProtoJets(particles,proJ,m_outputFinalStatePJKey)){ 00172 return StatusCode::FAILURE; 00173 } 00174 } 00175 } 00191 return StatusCode::SUCCESS; 00192 }
StatusCode Atlfast::AtlfastProtoJetMaker::finalize | ( | ) |
standard Athena-Algorithm method
Definition at line 118 of file AtlfastProtoJetMaker.cxx.
00119 { 00120 MsgStream log( messageService(), name() ); 00121 log << MSG::DEBUG <<"AtlfastProtoJetllMaker finalize()" << endreq; 00122 return StatusCode::SUCCESS; 00123 }
StatusCode Atlfast::AtlfastProtoJetMaker::FillProtoJets | ( | const std::vector< T1 * > & | , | |
T2 * | , | |||
const std::string & | ||||
) | [inline, private] |
Definition at line 99 of file AtlfastProtoJetMaker.h.
00101 { 00102 bool smear = false; 00103 return this->FillProtoJets(vec, 00104 proJ, 00105 PJoutputLocation, 00106 smear); 00107 }//----------------------------------------------------------------------
StatusCode Atlfast::AtlfastProtoJetMaker::FillProtoJets | ( | const std::vector< T1 * > & | , | |
T2 * | , | |||
const std::string & | , | |||
bool | ||||
) | [inline, private] |
Definition at line 111 of file AtlfastProtoJetMaker.h.
00114 { 00115 MsgStream log( messageService(), name() ) ; 00116 ProtoJetCollection<ProtoJet>* pjs = new ProtoJetCollection<ProtoJet>; 00117 typename std::vector<T1*>::const_iterator itr = vec.begin(); 00118 HepLorentzVector hepvec; 00119 for (; itr != vec.end(); ++itr) { 00120 hepvec = (*itr)->momentum(); 00121 if(smear){ 00122 hepvec = m_smearer->smear(hepvec); 00123 } 00124 proJ = new T2(hepvec); 00125 pjs->push_back(proJ); 00126 } 00127 log << MSG::DEBUG << "Size of vector"<<pjs->size() << endreq; 00128 //store protojets 00129 TesIoStat stat = m_tesIO -> store(pjs, PJoutputLocation); 00130 std::string message; 00131 message = stat ? "AtlfastProtoJet stored by key": 00132 "Failed to store AtlfastProtoJet by key"; 00133 log<<MSG::DEBUG<<message<<endreq; 00134 if (!stat) {return StatusCode::FAILURE;} 00135 return (stat)? StatusCode::SUCCESS:StatusCode::FAILURE; 00136 }//-------------------------------------------------------------------------
StatusCode Atlfast::AtlfastProtoJetMaker::FillProtoJets | ( | const std::vector< T1 * > & | , | |
T2 * | ||||
) | [inline, private] |
Definition at line 140 of file AtlfastProtoJetMaker.h.
00140 { 00141 MsgStream log( messageService(), name() ) ; 00142 ObjectVector<ProtoJet>* pjs = new ObjectVector<ProtoJet>; 00143 typename std::vector<T1*>::const_iterator itr = vec.begin(); 00144 for (; itr != vec.end(); ++itr) { 00145 proJ = new T2((*itr)->momentum()); 00146 pjs->push_back(proJ); 00147 } 00148 log << MSG::DEBUG << "Size of vector"<<pjs->size() << endreq; 00149 //store protojets 00150 TesIoStat stat = m_tesIO -> store(pjs); 00151 message = stat ? "AtlfastProtoJet stored by type": 00152 "Failed to store AtlfastProtoJet type"; 00153 log<<MSG::DEBUG<<message<<endreq; 00154 return (stat)? StatusCode::SUCCESS:StatusCode::FAILURE; 00155 }
std::string Atlfast::AtlfastProtoJetMaker::m_inputCellLocation [private] |
StoreGate Keys for input objects (Cells,CLusters)
Definition at line 59 of file AtlfastProtoJetMaker.h.
std::string Atlfast::AtlfastProtoJetMaker::m_inputClusterLocation [private] |
Definition at line 60 of file AtlfastProtoJetMaker.h.
std::string Atlfast::AtlfastProtoJetMaker::m_outputTowerPJKey [private] |
StoreGate Keys for output objects (ProtoJets)
Definition at line 62 of file AtlfastProtoJetMaker.h.
std::string Atlfast::AtlfastProtoJetMaker::m_outputClusterPJKey [private] |
Definition at line 63 of file AtlfastProtoJetMaker.h.
std::string Atlfast::AtlfastProtoJetMaker::m_outputFinalStatePJKey [private] |
Definition at line 64 of file AtlfastProtoJetMaker.h.
TesIO* Atlfast::AtlfastProtoJetMaker::m_tesIO [private] |
member variables
Definition at line 66 of file AtlfastProtoJetMaker.h.
bool Atlfast::AtlfastProtoJetMaker::m_towerPJConstruct [private] |
Definition at line 67 of file AtlfastProtoJetMaker.h.
bool Atlfast::AtlfastProtoJetMaker::m_clusterPJConstruct [private] |
Definition at line 68 of file AtlfastProtoJetMaker.h.
bool Atlfast::AtlfastProtoJetMaker::m_finalStatePJConstruct [private] |
Definition at line 69 of file AtlfastProtoJetMaker.h.
bool Atlfast::AtlfastProtoJetMaker::m_towerPJSmearOn [private] |
Definition at line 70 of file AtlfastProtoJetMaker.h.
bool Atlfast::AtlfastProtoJetMaker::m_clusterPJSmearOn [private] |
Definition at line 71 of file AtlfastProtoJetMaker.h.
std::string Atlfast::AtlfastProtoJetMaker::m_mcLocation [private] |
Definition at line 74 of file AtlfastProtoJetMaker.h.
ISmearer* Atlfast::AtlfastProtoJetMaker::m_smearer [private] |
Definition at line 82 of file AtlfastProtoJetMaker.h.