00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "AtlfastAlgs/CalSectionReject.h"
00017 #include "AtlfastEvent/ITransportedParticle.h"
00018 #include "AtlfastEvent/EPileupDeposit.h"
00019 #include "FastShowerUtils/Gridlet.h"
00020 #include "GaudiKernel/MsgStream.h"
00021 #include <iomanip>
00022 #include <iostream>
00023
00024
00025 #include <fstream>
00026
00027 namespace Atlfast{
00028 using std::ios;
00029 using std::setprecision;
00030 using std::setw;
00031 using std::ostream;
00032
00033 using FastShower::GridletElement;
00034
00035 CalSectionReject::CalSectionReject(double etaMin, double etaMax,
00036 double phiMin, double phiMax):
00037 m_etaMin(etaMin), m_etaMax(etaMax),
00038 m_phiMin(phiMin), m_phiMax(phiMax) {}
00039
00040 CalSectionReject::CalSectionReject(const CalSectionReject& other):
00041 m_etaMin(other.m_etaMin), m_etaMax(other.m_etaMax),
00042 m_phiMin(other.m_phiMin), m_phiMax(other.m_phiMax) {}
00048 bool CalSectionReject::operator()(const ITransportedParticle* p) {
00049 double eta = p->eta();
00050
00051 ::Phi phi = p->phi();
00052 if(eta<=m_etaMin || eta > m_etaMax) {
00053 return true;
00054 }
00055 if(phi<=m_phiMin || phi > m_phiMax){
00056 return true;
00057 }
00058 return false;
00059 }
00060
00061 bool CalSectionReject::operator()(const EPileupDeposit* p) {
00062 double eta = p->eta();
00063 ::Phi phi = p->phi();
00064 if(eta<=m_etaMin || eta > m_etaMax) return true;
00065 if(phi<=m_phiMin || phi > m_phiMax) return true;
00066 return false;
00067 }
00068
00069 bool CalSectionReject::operator()(const GridletElement* p) {
00070 double eta = p->eta();
00071 ::Phi phi = p->phi();
00072 if(eta<=m_etaMin || eta > m_etaMax) {return true;}
00073 if(phi<=m_phiMin || phi > m_phiMax) {return true;}
00074 return false;
00075 }
00076
00077 bool CalSectionReject::operator()(const Gridlet* g) {
00078 double eta = g->eta0();
00079 ::Phi phi = g->phi0();
00080 if(eta<=m_etaMin || eta > m_etaMax) return true;
00081 if(phi<=m_phiMin || phi > m_phiMax) return true;
00082 return false;
00083 }
00084
00085 MsgStream& CalSectionReject::writeout(MsgStream& stream) const{
00086 stream<<setiosflags(ios::fixed);
00087 stream<<setprecision(3);
00088 stream<<"Lower limits (phi, eta):"<<endreq;
00089 stream<< m_phiMin <<" "<<m_etaMin<<endreq;
00090 stream<<"Upper limit (phi, eta):"<<endreq;
00091 stream<< m_phiMax <<" "<<m_etaMax<<endreq;
00092 return stream;
00093 }
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 MsgStream& operator <<( MsgStream& stream, const CalSectionReject& c) {
00107 return c.writeout(stream);
00108 }
00109 MsgStream& operator <<( MsgStream& stream, const CalSectionReject* const c) {
00110 return (*c).writeout(stream);
00111 }
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 }
00123
00124
00125
00126
00127
00128
00129