#include <Calorimeter.h>
Collaboration diagram for Atlfast::Calorimeter:
Public Member Functions | |
Calorimeter (MsgStream &log, bool fastShower, const double etaCoverage, const double barrelForwardEta, const double granBarrelEta, const double granBarrelPhi, const double granForwardEta, const double granForwardPhi) | |
~Calorimeter () | |
Calorimeter (const Calorimeter &) | |
void | deposit (ITransportedParticleCollectionIter &first, ITransportedParticleCollectionIter &last) |
void | deposit (std::vector< Atlfast::EPileupDeposit * >::iterator &first, std::vector< Atlfast::EPileupDeposit * >::iterator &last) const |
const GridletForger * | gridletForger () const |
MsgStream & | msgStream () const |
void | addGridlet (Gridlet *g) |
void | reset () |
void | giveHitCells (const ICellSelector *, ITwoCptCellCollection *) |
void | smearCells (ISmearer *) |
Private Attributes | |
CalSection * | m_section [3] |
MsgStream & | m_log |
GridletForger * | m_gridletForger |
std::vector< const Gridlet * > | m_gridlets |
At present, state construction is not available through jobOptions directly and therefore all parameters are temporarily passed in the Calorimeter constructor (i.e. parameters are properties of CellMaker which then constructs Calorimeter). The calorimeter consists of three CalSections in which energies of HepMC particles are deposited.
Definition at line 54 of file Calorimeter.h.
Atlfast::Calorimeter::Calorimeter | ( | MsgStream & | log, | |
bool | fastShower, | |||
const double | etaCoverage, | |||
const double | barrelForwardEta, | |||
const double | granBarrelEta, | |||
const double | granBarrelPhi, | |||
const double | granForwardEta, | |||
const double | granForwardPhi | |||
) |
Constructor providing coverage and granularity parameters, set in CellMaker jobOptions.
Definition at line 35 of file Calorimeter.cxx.
00044 :m_log(log){ 00045 00046 m_section[0] = new CalSection(log, 00047 abs(barrelMaxEta), abs(MaxEta), 00048 granForwardEta, granForwardPhi); 00049 00050 m_section[1] = new CalSection(log, 00051 -abs(barrelMaxEta), abs(barrelMaxEta), 00052 granBarrelEta, granBarrelPhi); 00053 00054 m_section[2] = new CalSection(log, 00055 -abs(MaxEta), -abs(barrelMaxEta), 00056 granForwardEta, granForwardPhi); 00057 00058 if(fastShower) { 00059 m_gridletForger = new GridletForger; 00060 }else{ 00061 m_gridletForger = 0; 00062 } 00063 00064 }
Atlfast::Calorimeter::~Calorimeter | ( | ) |
Default destructor
Definition at line 65 of file Calorimeter.cxx.
00065 { 00066 m_log<<MSG::DEBUG<<"Calorimeter destructor starts "<<endreq; 00067 delete m_section[0]; 00068 delete m_section[1]; 00069 delete m_section[2]; 00070 delete m_gridletForger; 00071 m_log<<MSG::DEBUG<<"Calorimeter destructor ends "<<endreq; 00072 }
Atlfast::Calorimeter::Calorimeter | ( | const Calorimeter & | ) |
Copy constructor
Definition at line 73 of file Calorimeter.cxx.
00073 :m_log(c.m_log){ 00074 //make m_sections point to different instances 00075 // of the CalSections, with the same value as those 00076 //owned by c. 00077 m_section[0] = new CalSection(*(c.m_section[0])); 00078 m_section[1] = new CalSection(*(c.m_section[1])); 00079 m_section[2] = new CalSection(*(c.m_section[2])); 00080 m_gridletForger= new GridletForger(*(c.m_gridletForger)); 00081 }
void Atlfast::Calorimeter::deposit | ( | ITransportedParticleCollectionIter & | first, | |
ITransportedParticleCollectionIter & | last | |||
) |
Deposits HepMc::Particle. The double is the phi position of the particle* at the calorimeter. the "last" iterator will be modified...
Definition at line 116 of file Calorimeter.cxx.
00117 { 00118 00119 ITransportedParticleCollectionIter divider = 00120 std::partition(f, l, TryToShower(this)); 00121 00122 // std::for_each(m_gridlets.begin(), m_gridlets.end(), CheckNull()); 00123 00124 // put all the elements from all gridlets into a containers 00125 Elements els; 00126 els = std::for_each(m_gridlets.begin(), m_gridlets.end(), els); 00127 std::pair<Elements::Iter, Elements::Iter> ei = els.eIters(); 00128 std::pair<Elements::Iter, Elements::Iter> hi = els.hIters(); 00129 std::for_each(ei.first, ei.second, CheckNull()); 00130 std::for_each(hi.first, hi.second, CheckNull()); 00131 00132 // cerr<<"Calorimeter: no of e elements "<<ei.second - ei.first<<endl; 00133 // cerr<<"Calorimeter: no of h elements "<<hi.second - hi.first<<endl; 00134 00135 //Deposit Elements, generated particle energies for showered particles 00136 //(needed for calibration) and unshowered particles. 00137 for(int ind =0 ;ind<=2; ++ind){ 00138 // cerr<<"Calsection "<<ind<<endl; 00139 // cerr<<" E deposits "<<endl; 00140 // cerr<<" E deposits "<<endl; 00141 m_section[ind]->depositEcal(ei.first, ei.second); 00142 // cerr<<" H deposits "<<endl; 00143 m_section[ind]->depositHcal(hi.first, hi.second); 00144 00145 //need to make the iterators because the call is to references, 00146 //and so we need an object to reference. The following commented 00147 //out line does not work because there is nothing to reference! 00148 std::vector<const Gridlet*>::iterator b = m_gridlets.begin(); 00149 std::vector<const Gridlet*>::iterator e = m_gridlets.end(); 00150 // cerr<<" Egen deposits "<<endl; 00151 m_section[ind]->depositEgen(b, e); 00152 00153 //m_section[ind]->depositEgen(m_gridlets.begin(), m_gridlets.end()); 00154 // cerr<<" Particle deposits "<<endl; 00155 m_section[ind]->deposit(divider, l); 00156 } 00157 // the iterators have been messed around with , so get a fresh set before 00158 // deleting the elements 00159 ei = els.eIters(); 00160 hi = els.hIters(); 00161 std::for_each(ei.first, ei.second, DeleteObject()); 00162 std::for_each(hi.first, hi.second, DeleteObject()); 00163 }
void Atlfast::Calorimeter::deposit | ( | std::vector< Atlfast::EPileupDeposit * >::iterator & | first, | |
std::vector< Atlfast::EPileupDeposit * >::iterator & | last | |||
) | const |
Deposits Energy Pileup Map into the Calorimeter
Definition at line 167 of file Calorimeter.cxx.
00169 { 00170 //send energy pileup to calorimeter sections 00171 for(int ind =0 ;ind<=2; ++ind){ 00172 m_section[ind]->deposit(f, l); 00173 } 00174 00175 }
const GridletForger * Atlfast::Calorimeter::gridletForger | ( | ) | const |
give the GridletForger
Definition at line 177 of file Calorimeter.cxx.
00177 { 00178 return m_gridletForger; 00179 }
MsgStream & Atlfast::Calorimeter::msgStream | ( | ) | const |
make log available to those who want it
Definition at line 181 of file Calorimeter.cxx.
00181 {return m_log;}
void Atlfast::Calorimeter::addGridlet | ( | Gridlet * | g | ) |
Add to the collection of Gridlets
Definition at line 114 of file Calorimeter.cxx.
00114 {m_gridlets.push_back(g);}
void Atlfast::Calorimeter::reset | ( | ) |
Resets the calorimeter sections and local collections.
Definition at line 195 of file Calorimeter.cxx.
00195 { 00196 00197 for(int ind=0; ind<=2; ++ind) {m_section[ind]->reset();} 00198 00199 std::for_each(m_gridlets.begin(), m_gridlets.end(), DeleteObject()); 00200 m_gridlets.clear(); 00201 00202 }
void Atlfast::Calorimeter::giveHitCells | ( | const ICellSelector * | , | |
ITwoCptCellCollection * | ||||
) |
Gives selected cells.
Definition at line 183 of file Calorimeter.cxx.
00184 { 00185 00186 // return cells in calorimeter passed by cellSelector 00187 // could make type change from Calorimeter cells to TES cells here 00188 00189 for(int ind=0; ind<=2; ++ind) { 00190 m_section[ind]->giveHits(p_cellSelector, cells); 00191 } 00192 }
void Atlfast::Calorimeter::smearCells | ( | ISmearer * | ) |
Smear the cells resolution
Definition at line 204 of file Calorimeter.cxx.
00205 { 00206 for(int ind=0; ind<=2; ++ind) { 00207 m_section[ind]->smearCells(p_smearer); 00208 } 00209 }
CalSection* Atlfast::Calorimeter::m_section[3] [private] |
Three calorimeter sections owned by the calorimeter. 1
Definition at line 118 of file Calorimeter.h.
MsgStream& Atlfast::Calorimeter::m_log [private] |
Pointer to fastShowerer - 0 if no fast Showering
Definition at line 123 of file Calorimeter.h.
GridletForger* Atlfast::Calorimeter::m_gridletForger [private] |
Definition at line 124 of file Calorimeter.h.
std::vector<const Gridlet* > Atlfast::Calorimeter::m_gridlets [private] |
Definition at line 125 of file Calorimeter.h.