00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "AtlfastAlgs/CalSectionReject.h"
00017 #include "AtlfastAlgs/TransportedParticle.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 TransportedParticle* p) {
00049 double eta = ((p->particle())->momentum()).pseudoRapidity();
00050 ::Phi phi = p->phi();
00051 if(eta<=m_etaMin || eta > m_etaMax) return true;
00052 if(phi<=m_phiMin || phi > m_phiMax) return true;
00053 return false;
00054 }
00055
00056 bool CalSectionReject::operator()(const EPileupDeposit* p) {
00057 double eta = p->eta();
00058 ::Phi phi = p->phi();
00059 if(eta<=m_etaMin || eta > m_etaMax) return true;
00060 if(phi<=m_phiMin || phi > m_phiMax) return true;
00061 return false;
00062 }
00063
00064 bool CalSectionReject::operator()(const GridletElement* p) {
00065 double eta = p->eta();
00066 ::Phi phi = p->phi();
00067 if(eta<=m_etaMin || eta > m_etaMax) return true;
00068 if(phi<=m_phiMin || phi > m_phiMax) return true;
00069 return false;
00070 }
00071
00072 MsgStream& CalSectionReject::writeout(MsgStream& stream) const{
00073 stream<<setiosflags(ios::fixed);
00074 stream<<setprecision(3);
00075 stream<<"Lower limits (phi, eta):"<<endreq;
00076 stream<< m_phiMin <<" "<<m_etaMin<<endreq;
00077 stream<<"Upper limit (phi, eta):"<<endreq;
00078 stream<< m_phiMax <<" "<<m_etaMax<<endreq;
00079 return stream;
00080 }
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 MsgStream& operator <<( MsgStream& stream, const CalSectionReject& c) {
00094 return c.writeout(stream);
00095 }
00096 MsgStream& operator <<( MsgStream& stream, const CalSectionReject* const c) {
00097 return (*c).writeout(stream);
00098 }
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 }
00110
00111
00112
00113
00114
00115
00116