#include <CalSection.h>
Collaboration diagram for Atlfast::CalSection:
Public Methods | |
CalSection (MsgStream &log, const double minEta, const double maxEta, const double granEta, const double granPhi, const double minPhi=-M_PI, const double maxPhi=M_PI) | |
Constructor takes sensitivity parameters. | |
CalSection (const CalSection &c) | |
~CalSection () | |
void | reset () |
Resets the contents of the calorimeter section. | |
void | deposit (TransportedParticleCollectionIter &, TransportedParticleCollectionIter &) |
Takes the TransportedParticle (transported through mag field) and deposits it within the calorimeter section. | |
void | deposit (std::vector< Atlfast::EPileupDeposit * >::iterator &, std::vector< Atlfast::EPileupDeposit * >::iterator &) |
Takes the Energy pileup map and deposits it within the calorimeter section. | |
void | depositEcal (std::vector< GridletElement * >::iterator, std::vector< GridletElement * >::iterator) |
a deposit method into Ecal comaprtment (used with FastShower) | |
void | depositHcal (std::vector< GridletElement * >::iterator, std::vector< GridletElement * >::iterator) |
a deposit method into Hcal comaprtment (used with FastShower) | |
void | giveHits (const ICellSelector *, ITwoCptCellCollection *) const |
Returns a list of hit cells within the calorimeter section. | |
void | smearCells (ISmearer *) |
Smear the cells resolution. | |
Private Methods | |
void | newHit (const TransportedParticle *) |
Registers a new hit in the calorimeter section. | |
void | newHit (const EPileupDeposit *) |
Registers a new energy pileup in the calorimeter section. | |
void | newEHit (const GridletElement *) |
Registers a new deposit in the Ecal in the calorimeter section. | |
void | newHHit (const GridletElement *) |
Registers a new deposit in the Ecal in the calorimeter section. | |
int | index (const GridletElement *) const |
find the cell index for a variety of input arguments | |
int | index (const TransportedParticle *) const |
int | index (const Atlfast::EPileupDeposit *) const |
int | iindex (double phi, double eta) const |
Private Attributes | |
MsgStream & | m_log |
const double | m_minEta |
minimum Eta sensitivity | |
const double | m_maxEta |
maximum Eta sensitivity | |
const double | m_minPhi |
minimum phi sensitivity | |
const double | m_maxPhi |
maximum phi sensitivity | |
double | m_granEta |
granularity in eta | |
double | m_granPhi |
granularity in phi | |
int | m_nPhi |
number of cells in phi space | |
CalSectionReject | m_calSectionReject |
Calorimeter selection object. | |
std::vector< ITwoCptCell * > | m_cells |
Cells owned by calorimeter section. | |
std::map< int, ITwoCptCell *, std::less< int > > | m_hitCells |
It is used by the Calorimeter object to deposit HepMc particles
Definition at line 47 of file CalSection.h.
|
Constructor takes sensitivity parameters.
Definition at line 33 of file CalSection.cxx. References m_calSectionReject, m_cells, m_granEta, m_granPhi, m_maxPhi, m_minPhi, and m_nPhi.
00041 : 00042 m_log(log), 00043 m_minEta(minEta), m_maxEta(maxEta), 00044 m_minPhi(minPhi), m_maxPhi(maxPhi), 00045 m_calSectionReject(minEta, maxEta, minPhi, maxPhi){ 00046 00047 log <<MSG::DEBUG<< "CalSection: construction. Eta range: " 00048 <<minEta<<" - "<<maxEta<<endreq; 00049 log <<MSG::DEBUG<< " Phi range: " 00050 <<minPhi<<" - "<<maxPhi<<endreq; 00051 log <<MSG::DEBUG<< " starting granularity Eta: "<<granEta 00052 << " phi: "<<granPhi 00053 <<endreq; 00054 00055 log <<MSG::DEBUG<<"CalSectionReject parameters:"<<endreq; 00056 log <<MSG::DEBUG<<m_calSectionReject<<endreq; 00057 00058 int nEta = int(((maxEta-minEta)/granEta)+0.5); 00059 m_granEta = (maxEta-minEta)/int(nEta); 00060 m_nPhi = 1+int(((m_maxPhi-m_minPhi)/granPhi)+0.5); 00061 m_granPhi = (m_maxPhi-m_minPhi)/double(m_nPhi); 00062 log <<MSG::DEBUG<< " final granularity Eta: "<<m_granEta 00063 << " phi: "<<m_granPhi 00064 <<endreq; 00065 log <<MSG::DEBUG<< " final Bins in Eta: "<<nEta 00066 << " phi: "<<m_nPhi 00067 <<endreq; 00068 00069 for (int ieta=0; ieta<nEta; ieta++){ 00070 for (int iphi=0; iphi<m_nPhi; iphi++){ 00071 00072 double eta = minEta+((double(ieta)+0.5)*double(m_granEta)); 00073 double phi = m_minPhi + ((double(iphi)+0.5)*double(m_granPhi)); 00074 CellDescriptor id = CellDescriptor(eta,phi); 00075 ITwoCptCell* cell = new TwoCptCell(id); 00076 00077 m_cells.push_back(cell); 00078 } 00079 } 00080 } CalSection::~CalSection(){ |
|
Definition at line 87 of file CalSection.cxx. References m_cells.
00087 : 00088 m_log(c.m_log), 00089 m_minEta(c.m_minEta), 00090 m_maxEta(c.m_maxEta), 00091 m_minPhi(c.m_minPhi), 00092 m_maxPhi(c.m_maxPhi), 00093 m_granEta(c.m_granEta), 00094 m_granPhi(c.m_granPhi), 00095 m_nPhi(c.m_nPhi), 00096 m_calSectionReject(c.m_calSectionReject){ 00097 std::vector<ITwoCptCell*>::const_iterator i=c.m_cells.begin(); 00098 for(;i<c.m_cells.end();++i) m_cells.push_back((*i)->cloneITCC()); 00099 } //---------------------------------------------------------------- |
|
Definition at line 81 of file CalSection.cxx. References m_cells, and m_log.
|
|
Resets the contents of the calorimeter section.
Definition at line 277 of file CalSection.cxx. References m_hitCells. Referenced by Atlfast::Calorimeter::reset().
00277 { 00278 //reset the cells of this CalSection 00279 00280 std::map<int, ITwoCptCell*>::const_iterator i = m_hitCells.begin(); 00281 for(;i!=m_hitCells.end();++i) (*i).second->resetCell(); 00282 m_hitCells.erase(m_hitCells.begin(), m_hitCells.end()); 00283 } |
|
Takes the TransportedParticle (transported through mag field) and deposits it within the calorimeter section.
Definition at line 101 of file CalSection.cxx. References m_calSectionReject, newHit(), Atlfast::TransportedParticleCollectionCIter, and Atlfast::TransportedParticleCollectionIter. Referenced by Atlfast::Calorimeter::deposit().
00102 { 00103 // remove particles not in acceptance 00104 TransportedParticleCollectionIter divider; 00105 divider = std::partition(f, l, m_calSectionReject); 00106 00107 // fill cells 00108 for(TransportedParticleCollectionCIter i=divider; i<l; ++i){newHit(*i);} 00109 00110 // assume sections do not overlap: do not reprocess. 00111 l=divider; 00112 } |
|
Takes the Energy pileup map and deposits it within the calorimeter section.
Definition at line 220 of file CalSection.cxx. References m_calSectionReject, and newHit().
00221 { 00222 // remove pileup deposits not in acceptance 00223 std::vector<Atlfast::EPileupDeposit*>::iterator divider; 00224 divider = std::partition(f, l, m_calSectionReject); 00225 00226 // fill cells 00227 std::vector<Atlfast::EPileupDeposit*>::iterator i=divider; 00228 for(; i<l; ++i) newHit(*i); 00229 00230 // assume sections do not overlap: do not reprocess. 00231 // hits processed here: set last to end of unprocessed hits 00232 l=divider; 00233 } |
|
a deposit method into Ecal comaprtment (used with FastShower)
Definition at line 114 of file CalSection.cxx. References m_calSectionReject, and newEHit(). Referenced by Atlfast::Calorimeter::deposit().
00116 { 00117 00118 std::vector<GridletElement*>::iterator divider; 00119 divider = std::partition(f, l, m_calSectionReject); 00120 00121 std::vector<GridletElement*>::iterator i; 00122 for( i=divider; i<l; ++i){newEHit(*i);} 00123 00124 // assume sections do not overlap: do not reprocess. 00125 l=divider; 00126 } |
|
a deposit method into Hcal comaprtment (used with FastShower)
Definition at line 128 of file CalSection.cxx. References m_calSectionReject, and newHHit(). Referenced by Atlfast::Calorimeter::deposit().
00130 { 00131 00132 std::vector<GridletElement*>::iterator divider; 00133 divider = std::partition(f, l, m_calSectionReject); 00134 00135 std::vector<GridletElement*>::iterator i; 00136 for( i=divider; i<l; ++i){newHHit(*i);} 00137 00138 // assume sections do not overlap: do not reprocess. 00139 l=divider; 00140 } |
|
Returns a list of hit cells within the calorimeter section.
Definition at line 250 of file CalSection.cxx. Referenced by Atlfast::Calorimeter::giveHitCells().
00250 { 00251 std::map<int, ITwoCptCell*, std::less<int> >::const_iterator i; 00252 for(i=m_hitCells.begin(); i!=m_hitCells.end(); ++i){ 00253 //test cell before newing and filling vector 00254 if( (*p_cellselect) (((*i).second))){ 00255 ITwoCptCell* cell = ((*i).second)->cloneITCC(); 00256 //Need to copy cells because Athena deletes container AND POINTERS 00257 // AND POINTEES 00258 cells->push_back(cell); 00259 } 00260 } 00261 00262 } |
|
Smear the cells resolution.
Definition at line 265 of file CalSection.cxx. Referenced by Atlfast::Calorimeter::smearCells().
00265 { 00266 std::map<int, ITwoCptCell*, std::less<int> >::const_iterator i; 00267 for(i=m_hitCells.begin(); i!=m_hitCells.end(); ++i){ 00268 if((*((*i).second)).momentum().e() > 0){ 00269 HepLorentzVector temp = p_smearer->smear((*((*i).second)).momentum()); 00270 (*((*i).second)).setPt(temp); 00271 } 00272 } 00273 } |
|
Registers a new hit in the calorimeter section.
Definition at line 142 of file CalSection.cxx. References iindex(), m_cells, m_granEta, m_granPhi, m_hitCells, Atlfast::TransportedParticle::particle(), and Atlfast::TransportedParticle::phi(). Referenced by deposit().
00142 { 00143 //check cell is reasonable 00144 const HepMC::GenParticle* particle = tp->particle(); 00145 const double eta = particle->momentum().pseudoRapidity(); 00146 const double phi = tp->phi(); 00147 int ind = iindex(phi, eta); 00148 ITwoCptCell* cell = m_cells[ind]; 00149 assert(abs( eta-(cell->eta()) ) <m_granEta); 00150 assert(abs( phi-(cell->phi()) ) <m_granPhi); 00151 cell->newHit(particle); 00152 //use a map to store pointers to hit cells to avoid 00153 //duplicate entries if the cell is hit more than once. 00154 m_hitCells[ind] = cell; 00155 00156 return; 00157 } |
|
Registers a new energy pileup in the calorimeter section.
Definition at line 236 of file CalSection.cxx. References index(), m_cells, m_granEta, m_granPhi, and m_hitCells.
00236 { 00237 //check cell is reasonable 00238 int ind = index(ep); 00239 ITwoCptCell* cell = m_cells[ind]; 00240 assert(abs( (ep->eta()) - (cell->eta()) )<m_granEta); 00241 assert(abs( (ep->phi()) - (cell->phi()) )<m_granPhi); 00242 cell->newHit(ep); 00243 //use a map to store pointers to hit cells to avoid 00244 //duplicate entries if the cell is hit more than once. 00245 m_hitCells[ind] = cell; 00246 return; 00247 } |
|
Registers a new deposit in the Ecal in the calorimeter section.
Definition at line 159 of file CalSection.cxx. References index(), m_cells, m_granEta, m_granPhi, and m_hitCells. Referenced by depositEcal().
00159 { 00160 int ind = index(ge); 00161 ITwoCptCell* cell = m_cells[ind]; 00162 // cerr<<"gridletEl, phi, eta, eT: " 00163 // <<ge->phi()<<" "<<ge->eta()<<" "<<ge->et()<<endl; 00164 // cerr<<"cell, phi, eta, granularity: "<<cell->phi()<<" "<<cell->eta() 00165 // <<" "<<m_granPhi<<" "<<m_granEta<<endl; 00166 assert(abs( (ge->eta()-cell->eta()) )<m_granEta); 00167 assert(abs( (ge->phi()-cell->phi()) )<m_granPhi); 00168 cell->depositEcal(ge->et()); 00169 //use a map to store pointers to hit cells to avoid 00170 //duplicate entries if the cell is hit more than once. 00171 m_hitCells[ind] = cell; 00172 00173 return; 00174 } |
|
Registers a new deposit in the Ecal in the calorimeter section.
Definition at line 176 of file CalSection.cxx. References index(), m_cells, m_granEta, m_granPhi, and m_hitCells. Referenced by depositHcal().
00176 { 00177 int ind = index(ge); 00178 ITwoCptCell* cell = m_cells[ind]; 00179 // cerr<<"gridletEl, phi, eta, eT: " 00180 // <<ge->phi()<<" "<<ge->eta()<<" "<<ge->et()<<endl; 00181 // cerr<<"cell, phi, eta, granularity: "<<cell->phi()<<" "<<cell->eta() 00182 // <<" "<<m_granPhi<<" "<<m_granEta<<endl; 00183 assert(abs( (ge->eta())-(cell->eta()) )<m_granEta); 00184 assert(abs( (ge->phi())-(cell->phi()) )<m_granPhi); 00185 cell->depositHcal(ge->et()); 00186 //use a map to store pointers to hit cells to avoid 00187 //duplicate entries if the cell is hit more than once. 00188 m_hitCells[ind] = cell; 00189 00190 return; 00191 } |
|
find the cell index for a variety of input arguments
Definition at line 193 of file CalSection.cxx. References iindex(). Referenced by newEHit(), newHHit(), and newHit().
00193 { 00194 int ind = this->iindex( ge->phi(), ge->eta() ); 00195 return ind; 00196 } |
|
Definition at line 198 of file CalSection.cxx. References iindex(), Atlfast::TransportedParticle::particle(), and Atlfast::TransportedParticle::phi().
00198 { 00199 const HepMC::GenParticle* particle = tp->particle(); 00200 const double eta = particle->momentum().pseudoRapidity(); 00201 const double phi = tp->phi(); 00202 int ind = iindex(phi, eta); 00203 return ind; 00204 } |
|
Definition at line 206 of file CalSection.cxx. References iindex().
00206 { 00207 int ind = iindex(ep->phi(),ep->eta()); 00208 return ind; 00209 } |
|
Definition at line 211 of file CalSection.cxx. References m_granEta, m_granPhi, m_minEta, m_minPhi, and m_nPhi. Referenced by index(), and newHit().
|
|
Definition at line 95 of file CalSection.h. Referenced by ~CalSection(). |
|
minimum Eta sensitivity
Definition at line 110 of file CalSection.h. Referenced by iindex(). |
|
maximum Eta sensitivity
Definition at line 112 of file CalSection.h. |
|
minimum phi sensitivity
Definition at line 114 of file CalSection.h. Referenced by CalSection(), and iindex(). |
|
maximum phi sensitivity
Definition at line 116 of file CalSection.h. Referenced by CalSection(). |
|
granularity in eta
Definition at line 118 of file CalSection.h. Referenced by CalSection(), iindex(), newEHit(), newHHit(), and newHit(). |
|
granularity in phi
Definition at line 120 of file CalSection.h. Referenced by CalSection(), iindex(), newEHit(), newHHit(), and newHit(). |
|
number of cells in phi space
Definition at line 122 of file CalSection.h. Referenced by CalSection(), and iindex(). |
|
Calorimeter selection object.
Definition at line 126 of file CalSection.h. Referenced by CalSection(), deposit(), depositEcal(), and depositHcal(). |
|
Cells owned by calorimeter section.
Definition at line 130 of file CalSection.h. Referenced by CalSection(), newEHit(), newHHit(), newHit(), and ~CalSection(). |
|
Definition at line 131 of file CalSection.h. |