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 "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 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   //debug
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   //debug
00082   //  ostream& CalSectionReject::writeout(ostream& stream) const{
00083   //  stream<<setiosflags(ios::fixed);
00084   //  stream<<setprecision(3);
00085   //  stream<<"Lower limits (phi, eta):"<<endreq;
00086   //  stream<< m_phiMin <<" "<<m_etaMin<<endreq;
00087   //  stream<<"Upper limit (phi, eta):"<<endreq;
00088   //  stream<< m_phiMax <<" "<<m_etaMax<<endreq;
00089   //  return stream;
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   //  ostream& operator <<( ostream& stream, const CalSectionReject& c) {
00101   //    return c.writeout(stream);
00102   //  }
00103   //  ostream& operator <<( ostream& stream, const CalSectionReject* const c) {
00104   //    return (*c).writeout(stream);
00105   //  }
00106 
00107 
00108 
00109 }//namespace
00110 
00111 
00112 
00113 
00114 
00115 
00116 

Generated on Tue Mar 18 11:18:22 2003 for AtlfastAlgs by doxygen1.3-rc1