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 "GaudiKernel/MsgStream.h"
00020 #include <iomanip>
00021 #include <iostream>
00022
00023
00024 #include <fstream>
00025
00026 namespace Atlfast{
00027 using std::ios;
00028 using std::setprecision;
00029 using std::setw;
00030 using std::ostream;
00031 CalSectionReject::CalSectionReject(double etaMin, double etaMax,
00032 double phiMin, double phiMax):
00033 m_etaMin(etaMin), m_etaMax(etaMax),
00034 m_phiMin(phiMin), m_phiMax(phiMax) {}
00035
00036 CalSectionReject::CalSectionReject(const CalSectionReject& other):
00037 m_etaMin(other.m_etaMin), m_etaMax(other.m_etaMax),
00038 m_phiMin(other.m_phiMin), m_phiMax(other.m_phiMax) {}
00044 bool CalSectionReject::operator()(const TransportedParticle* p) {
00045 double eta = ((p->particle())->momentum()).pseudoRapidity();
00046 ::Phi phi = p->phi();
00047 if(eta<=m_etaMin || eta > m_etaMax) return true;
00048 if(phi<=m_phiMin || phi > m_phiMax) return true;
00049 return false;
00050 }
00051
00052 bool CalSectionReject::operator()(const EPileupDeposit* p) {
00053 double eta = p->eta();
00054 ::Phi phi = p->phi();
00055 if(eta<=m_etaMin || eta > m_etaMax) return true;
00056 if(phi<=m_phiMin || phi > m_phiMax) return true;
00057 return false;
00058 }
00059
00060 MsgStream& CalSectionReject::writeout(MsgStream& stream) const{
00061 stream<<setiosflags(ios::fixed);
00062 stream<<setprecision(3);
00063 stream<<"Lower limits (phi, eta):"<<endreq;
00064 stream<< m_phiMin <<" "<<m_etaMin<<endreq;
00065 stream<<"Upper limit (phi, eta):"<<endreq;
00066 stream<< m_phiMax <<" "<<m_etaMax<<endreq;
00067 return stream;
00068 }
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 MsgStream& operator <<( MsgStream& stream, const CalSectionReject& c) {
00082 return c.writeout(stream);
00083 }
00084 MsgStream& operator <<( MsgStream& stream, const CalSectionReject* const c) {
00085 return (*c).writeout(stream);
00086 }
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 }
00098
00099
00100
00101
00102
00103
00104