Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CalSectionReject.cxx

Go to the documentation of this file.
00001 //=================================================
00002 //
00003 //
00004 // Selector function object used by CalSection to
00005 // make acceptance cuts on particles.
00006 //
00007 // Cuts on:
00008 //
00009 // pseudoRapidity - from CLHEP momentum
00010 // phi            - given separately (eg rotated by B field) 
00011 //
00012 // Author: Peter Sherwood
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 //#include <ios>
00023 //#include <iomanip>
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   //debug
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   //debug
00070   //  ostream& CalSectionReject::writeout(ostream& stream) const{
00071   //  stream<<setiosflags(ios::fixed);
00072   //  stream<<setprecision(3);
00073   //  stream<<"Lower limits (phi, eta):"<<endreq;
00074   //  stream<< m_phiMin <<" "<<m_etaMin<<endreq;
00075   //  stream<<"Upper limit (phi, eta):"<<endreq;
00076   //  stream<< m_phiMax <<" "<<m_etaMax<<endreq;
00077   //  return stream;
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   //  ostream& operator <<( ostream& stream, const CalSectionReject& c) {
00089   //    return c.writeout(stream);
00090   //  }
00091   //  ostream& operator <<( ostream& stream, const CalSectionReject* const c) {
00092   //    return (*c).writeout(stream);
00093   //  }
00094 
00095 
00096 
00097 }//namespace
00098 
00099 
00100 
00101 
00102 
00103 
00104 

Generated on Tue Jan 28 09:57:12 2003 for AtlfastAlgs by doxygen1.3-rc1