#include <AtlfastProtoJetMaker.h>
Collaboration diagram for Atlfast::AtlfastProtoJetMaker:
Public Methods | |
AtlfastProtoJetMaker (const std::string &name, ISvcLocator *pSvcLocator) | |
Standard Athena-Algorithm Constructor. | |
~AtlfastProtoJetMaker () | |
Default Destructor. | |
StatusCode | initialize () |
standard Athena-Algorithm method | |
StatusCode | execute () |
standard Athena-Algorithm method | |
StatusCode | finalize () |
standard Athena-Algorithm method | |
Private Methods | |
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 |
StoreGate Keys for input objects (Cells,CLusters). | |
std::string | m_inputClusterLocation |
std::string | m_outputTowerPJKey |
StoreGate Keys for output objects (ProtoJets). | |
std::string | m_outputClusterPJKey |
std::string | m_outputFinalStatePJKey |
TesIO * | m_tesIO |
member variables | |
bool | m_towerPJConstruct |
bool | m_clusterPJConstruct |
bool | m_finalStatePJConstruct |
bool | m_towerPJSmearOn |
bool | m_clusterPJSmearOn |
ISmearer * | m_smearer |
It stores them in the TES via StoreGate.
Definition at line 37 of file AtlfastProtoJetMaker.h.
|
Standard Athena-Algorithm Constructor.
Definition at line 40 of file AtlfastProtoJetMaker.cxx. References m_clusterPJConstruct, m_clusterPJSmearOn, m_finalStatePJConstruct, m_inputCellLocation, m_inputClusterLocation, m_outputClusterPJKey, m_outputFinalStatePJKey, m_outputTowerPJKey, m_towerPJConstruct, and m_towerPJSmearOn.
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 } |
|
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 }
|
|
standard Athena-Algorithm method
Definition at line 81 of file AtlfastProtoJetMaker.cxx. References Atlfast::GlobalEventData::barrelForwardEta(), Atlfast::GlobalEventData::lumi(), m_clusterPJConstruct, m_clusterPJSmearOn, m_finalStatePJConstruct, m_inputCellLocation, m_inputClusterLocation, m_outputClusterPJKey, m_outputFinalStatePJKey, m_outputTowerPJKey, m_smearer, m_tesIO, m_towerPJConstruct, m_towerPJSmearOn, and Atlfast::GlobalEventData::randSeed().
00082 { 00083 00084 MsgStream log( messageService(), name() ); 00085 log << MSG::DEBUG <<"AtlfastProtoJetllMaker initialize()" << endreq; 00086 m_tesIO = new TesIO(); 00087 //get the Global Event Data using singleton pattern 00088 GlobalEventData* ged = GlobalEventData::Instance(); 00089 00090 int lumi = ged->lumi(); 00091 int randSeed = ged->randSeed() ; 00092 double barrelForwardEta = ged->barrelForwardEta(); 00093 00094 m_smearer = new JetSmearer(randSeed, 00095 lumi, 00096 0., 00097 0., 00098 barrelForwardEta); 00099 00100 HeaderPrinter hp("Atlfast-ProtoJet Maker:", log); 00101 hp.add("Input Cell Key ", m_inputCellLocation); 00102 hp.add("Input Cluster Key ", m_inputClusterLocation); 00103 hp.add("Output Tower PJ Key ", m_outputTowerPJKey); 00104 hp.add("Output Cluster PJ Key ", m_outputClusterPJKey); 00105 hp.add("Output FinalState PJ Key ", m_outputFinalStatePJKey); 00106 hp.add("Construct Tower ProtoJets ", m_towerPJConstruct); 00107 hp.add("Construct Cluster ProtoJets ", m_clusterPJConstruct); 00108 hp.add("Construct Final State ProtoJets ", m_finalStatePJConstruct); 00109 hp.add("Smear Tower ProtoJets ", m_towerPJSmearOn); 00110 hp.add("Smear Cluster ProtoJets ", m_clusterPJSmearOn); 00111 hp.print(); 00112 00113 00114 return StatusCode::SUCCESS; 00115 } |
|
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 125 of file AtlfastProtoJetMaker.cxx. References FillProtoJets(), m_clusterPJSmearOn, m_inputCellLocation, m_inputClusterLocation, m_outputClusterPJKey, m_outputFinalStatePJKey, m_outputTowerPJKey, m_tesIO, and m_towerPJSmearOn.
00126 { 00127 //............................................. 00128 00129 MsgStream log( messageService(), name() ); 00130 std::string message; 00131 log << MSG::DEBUG << "AtlfastProtoJetMaker execute()" << endreq; 00132 00133 AtlfastProtoJet* proJ; 00134 //do protojet filling from now on--------------------- 00135 if(m_towerPJConstruct){ 00136 //Get the cells from storeGate 00137 std::vector<const ICell*> cells; 00138 TesIoStat stat = 00139 m_tesIO->copy<ICellCollection>(cells,m_inputCellLocation); 00140 message = stat? "Found Cells in TES":"No Cells in TES"; 00141 log<<MSG::DEBUG << message <<endreq; 00142 if(stat){ 00143 if(!this->FillProtoJets(cells,proJ,m_outputTowerPJKey,m_towerPJSmearOn)){ 00144 return StatusCode::FAILURE; 00145 } 00146 } 00147 } 00148 00149 if(m_clusterPJConstruct){ 00150 //Get the clusters from storeGate 00151 std::vector<Cluster*> clusters; 00152 TesIoStat stat = 00153 m_tesIO->copy<ClusterCollection>(clusters,m_inputClusterLocation); 00154 message = stat? "Found Clusters in TES":"No Clusters in TES"; 00155 log<<MSG::DEBUG << message <<endreq; 00156 if(stat){ 00157 if(!this->FillProtoJets(clusters,proJ,m_outputClusterPJKey,m_clusterPJSmearOn)){ 00158 return StatusCode::FAILURE; 00159 } 00160 } 00161 } 00162 if(m_finalStatePJConstruct){ 00163 //Get the FinalStateParticles from storeGate 00164 HepMC_helper::IsFinalState ifs; 00165 MCparticleCollection particles; 00166 TesIoStat stat = m_tesIO->getMC(particles, &ifs); 00167 message = stat? "Found FS Particles in TES":"No FS Particles in TES"; 00168 log<<MSG::DEBUG << message <<endreq; 00169 if(stat){ 00170 if(!this->FillProtoJets(particles,proJ,m_outputFinalStatePJKey)){ 00171 return StatusCode::FAILURE; 00172 } 00173 } 00174 } 00190 return StatusCode::SUCCESS; 00191 } |
|
standard Athena-Algorithm method
Definition at line 117 of file AtlfastProtoJetMaker.cxx.
00118 { 00119 MsgStream log( messageService(), name() ); 00120 log << MSG::DEBUG <<"AtlfastProtoJetllMaker finalize()" << endreq; 00121 return StatusCode::SUCCESS; 00122 } |
|
Definition at line 94 of file AtlfastProtoJetMaker.h. Referenced by execute().
00096 { 00097 bool smear = false; 00098 return this->FillProtoJets(vec, 00099 proJ, 00100 PJoutputLocation, 00101 smear); 00102 }//---------------------------------------------------------------------- |
|
Definition at line 106 of file AtlfastProtoJetMaker.h. References m_smearer, m_tesIO, and Atlfast::ISmearer::smear().
00109 { 00110 MsgStream log( messageService(), name() ) ; 00111 ProtoJetCollection<ProtoJet>* pjs = new ProtoJetCollection<ProtoJet>; 00112 typename std::vector<T1*>::const_iterator itr = vec.begin(); 00113 HepLorentzVector hepvec; 00114 for (; itr != vec.end(); ++itr) { 00115 hepvec = (*itr)->momentum(); 00116 if(smear){ 00117 hepvec = m_smearer->smear(hepvec); 00118 } 00119 proJ = new T2(hepvec); 00120 pjs->push_back(proJ); 00121 } 00122 log << MSG::DEBUG << "Size of vector"<<pjs->size() << endreq; 00123 //store protojets 00124 TesIoStat stat = m_tesIO -> store(pjs, PJoutputLocation); 00125 std::string message; 00126 message = stat ? "AtlfastProtoJet stored by key": 00127 "Failed to store AtlfastProtoJet by key"; 00128 log<<MSG::DEBUG<<message<<endreq; 00129 if (!stat) {return StatusCode::FAILURE;} 00130 return (stat)? StatusCode::SUCCESS:StatusCode::FAILURE; 00131 }//------------------------------------------------------------------------- |
|
Definition at line 135 of file AtlfastProtoJetMaker.h. References m_tesIO.
00135 { 00136 MsgStream log( messageService(), name() ) ; 00137 ObjectVector<ProtoJet>* pjs = new ObjectVector<ProtoJet>; 00138 typename std::vector<T1*>::const_iterator itr = vec.begin(); 00139 for (; itr != vec.end(); ++itr) { 00140 proJ = new T2((*itr)->momentum()); 00141 pjs->push_back(proJ); 00142 } 00143 log << MSG::DEBUG << "Size of vector"<<pjs->size() << endreq; 00144 //store protojets 00145 TesIoStat stat = m_tesIO -> store(pjs); 00146 message = stat ? "AtlfastProtoJet stored by type": 00147 "Failed to store AtlfastProtoJet type"; 00148 log<<MSG::DEBUG<<message<<endreq; 00149 return (stat)? StatusCode::SUCCESS:StatusCode::FAILURE; 00150 } |
|
StoreGate Keys for input objects (Cells,CLusters).
Definition at line 59 of file AtlfastProtoJetMaker.h. Referenced by AtlfastProtoJetMaker(), execute(), and initialize(). |
|
Definition at line 60 of file AtlfastProtoJetMaker.h. Referenced by AtlfastProtoJetMaker(), execute(), and initialize(). |
|
StoreGate Keys for output objects (ProtoJets).
Definition at line 62 of file AtlfastProtoJetMaker.h. Referenced by AtlfastProtoJetMaker(), execute(), and initialize(). |
|
Definition at line 63 of file AtlfastProtoJetMaker.h. Referenced by AtlfastProtoJetMaker(), execute(), and initialize(). |
|
Definition at line 64 of file AtlfastProtoJetMaker.h. Referenced by AtlfastProtoJetMaker(), execute(), and initialize(). |
|
member variables
Definition at line 66 of file AtlfastProtoJetMaker.h. Referenced by execute(), FillProtoJets(), and initialize(). |
|
Definition at line 67 of file AtlfastProtoJetMaker.h. Referenced by AtlfastProtoJetMaker(), and initialize(). |
|
Definition at line 68 of file AtlfastProtoJetMaker.h. Referenced by AtlfastProtoJetMaker(), and initialize(). |
|
Definition at line 69 of file AtlfastProtoJetMaker.h. Referenced by AtlfastProtoJetMaker(), and initialize(). |
|
Definition at line 70 of file AtlfastProtoJetMaker.h. Referenced by AtlfastProtoJetMaker(), execute(), and initialize(). |
|
Definition at line 71 of file AtlfastProtoJetMaker.h. Referenced by AtlfastProtoJetMaker(), execute(), and initialize(). |
|
Definition at line 77 of file AtlfastProtoJetMaker.h. Referenced by FillProtoJets(), and initialize(). |