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 "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 //#include <ios>
00024 //#include <iomanip>
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     //double eta = ((p->particle())->momentum()).pseudoRapidity();
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   //debug
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   //debug
00095   //  ostream& CalSectionReject::writeout(ostream& stream) const{
00096   //  stream<<setiosflags(ios::fixed);
00097   //  stream<<setprecision(3);
00098   //  stream<<"Lower limits (phi, eta):"<<endreq;
00099   //  stream<< m_phiMin <<" "<<m_etaMin<<endreq;
00100   //  stream<<"Upper limit (phi, eta):"<<endreq;
00101   //  stream<< m_phiMax <<" "<<m_etaMax<<endreq;
00102   //  return stream;
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   //  ostream& operator <<( ostream& stream, const CalSectionReject& c) {
00114   //    return c.writeout(stream);
00115   //  }
00116   //  ostream& operator <<( ostream& stream, const CalSectionReject* const c) {
00117   //    return (*c).writeout(stream);
00118   //  }
00119 
00120 
00121 
00122 }//namespace
00123 
00124 
00125 
00126 
00127 
00128 
00129 

Generated on Mon Sep 24 14:19:11 2007 for AtlfastAlgs by  doxygen 1.5.1