#include <RecoParticleFlow/PFClusterTools/interface/SpaceVoxel.h>
Public Member Functions | |
virtual bool | contains (const double &eta, const double &phi, const double &energy, const bool &ecalValid, const bool &hcalValid) const |
virtual bool | contains (const double &eta, const double &phi, const double &energy) const |
virtual bool | containsEnergy (const double &energy) const |
virtual bool | containsEta (const double &eta) const |
virtual bool | containsPhi (const double &phi) const |
virtual bool | ecalValid () const |
void | getName (std::string &s) const |
virtual bool | hcalValid () const |
double | maxEnergy () const |
double | minEnergy () const |
bool | operator() (const boost::shared_ptr< SpaceVoxel > &sv1, const boost::shared_ptr< SpaceVoxel > &sv2) |
bool | operator() (const SpaceVoxel &sv1, const SpaceVoxel &sv2) |
void | print (std::ostream &s) const |
void | printMsg () |
SpaceVoxel (double etaBegin=0, double etaEnd=0, double phiBegin=0, double phiEnd=0, double energyBegin=0, double energyEnd=0, bool ecalValid=true, bool hcalValid=true) | |
virtual | ~SpaceVoxel () |
Private Attributes | |
bool | ecalValid_ |
bool | hcalValid_ |
double | myEnergyMax |
double | myEnergyMin |
double | myEtaMax |
double | myEtaMin |
double | myPhiMax |
double | myPhiMin |
Friends | |
std::ostream & | operator<< (std::ostream &s, const pftools::SpaceVoxel &sv) |
Definition at line 15 of file SpaceVoxel.h.
SpaceVoxel::SpaceVoxel | ( | double | etaBegin = 0 , |
|
double | etaEnd = 0 , |
|||
double | phiBegin = 0 , |
|||
double | phiEnd = 0 , |
|||
double | energyBegin = 0 , |
|||
double | energyEnd = 0 , |
|||
bool | ecalValid = true , |
|||
bool | hcalValid = true | |||
) |
Definition at line 6 of file SpaceVoxel.cc.
References GenMuonPlsPt100GeV_cfg::cout, ecalValid_, lat::endl(), and hcalValid_.
00007 : 00008 myEtaMin(etaBegin), myEtaMax(etaEnd), myPhiMin(phiBegin), myPhiMax(phiEnd), 00009 myEnergyMin(energyBegin), myEnergyMax(energyEnd), 00010 ecalValid_(ecalValid), hcalValid_(hcalValid) { 00011 if (!ecalValid_ && !hcalValid_) { 00012 //erm, it has to be valid for one of them at least! 00013 std::cout << __PRETTY_FUNCTION__ 00014 << ": WARNING! Constructed with both ecalValid and hcalValid = false!" 00015 << std::endl; 00016 } 00017 }
SpaceVoxel::~SpaceVoxel | ( | ) | [virtual] |
bool SpaceVoxel::contains | ( | const double & | eta, | |
const double & | phi, | |||
const double & | energy, | |||
const bool & | ecalValid, | |||
const bool & | hcalValid | |||
) | const [virtual] |
Definition at line 29 of file SpaceVoxel.cc.
References contains(), ecalValid_, and hcalValid_.
00030 { 00031 if (contains(eta, phi, energy) && ecalValid == ecalValid_ && hcalValid 00032 == hcalValid_) 00033 return true; 00034 return false; 00035 }
bool SpaceVoxel::contains | ( | const double & | eta, | |
const double & | phi, | |||
const double & | energy | |||
) | const [virtual] |
Definition at line 22 of file SpaceVoxel.cc.
References containsEnergy(), containsEta(), and containsPhi().
Referenced by contains().
00023 { 00024 if (containsEta(eta) && containsPhi(phi) && containsEnergy(energy)) 00025 return true; 00026 return false; 00027 }
bool SpaceVoxel::containsEnergy | ( | const double & | energy | ) | const [virtual] |
Definition at line 56 of file SpaceVoxel.cc.
References myEnergyMax, and myEnergyMin.
Referenced by contains().
00056 { 00057 if (myEnergyMin == myEnergyMax) 00058 return true; 00059 if (energy < myEnergyMax && energy >= myEnergyMin) 00060 return true; 00061 //std::cout << "\tenergy fails!: input " << energy << " not in " << myEnergyMin << ", " << myEnergyMax <<"\n"; 00062 return false; 00063 }
bool SpaceVoxel::containsEta | ( | const double & | eta | ) | const [virtual] |
Definition at line 37 of file SpaceVoxel.cc.
References myEtaMax, and myEtaMin.
Referenced by contains().
00037 { 00038 if (myEtaMin == myEtaMax) 00039 return true; 00040 if (eta < myEtaMax && eta >= myEtaMin) 00041 return true; 00042 //::cout << "\teta fails!\n"; 00043 return false; 00044 }
bool SpaceVoxel::containsPhi | ( | const double & | phi | ) | const [virtual] |
Definition at line 46 of file SpaceVoxel.cc.
References myPhiMax, and myPhiMin.
Referenced by contains().
00046 { 00047 if (myPhiMin == myPhiMax) 00048 return true; 00049 if (phi < myPhiMax && phi >= myPhiMin) 00050 return true; 00051 //std::cout << "\tphi fails!\n"; 00052 return false; 00053 00054 }
virtual bool pftools::SpaceVoxel::ecalValid | ( | ) | const [inline, virtual] |
Definition at line 51 of file SpaceVoxel.h.
References ecalValid_.
00051 { 00052 return ecalValid_; 00053 }
void SpaceVoxel::getName | ( | std::string & | s | ) | const |
Definition at line 76 of file SpaceVoxel.cc.
References ecalValid_, hcalValid_, myEnergyMax, myEnergyMin, myEtaMax, myEtaMin, myPhiMax, myPhiMin, and toString().
00076 { 00077 s.append("SpaceVoxel: "); 00078 if (ecalValid_) 00079 s.append("E"); 00080 if (hcalValid_) 00081 s.append("H"); 00082 s.append(", eta: ["); 00083 s.append(toString(myEtaMin)); 00084 s.append(", "); 00085 s.append(toString(myEtaMax)); 00086 s.append("] phi: ["); 00087 s.append(toString(myPhiMin)); 00088 s.append(", "); 00089 s.append(toString(myPhiMax)); 00090 s.append("], en: ["); 00091 s.append(toString(myEnergyMin)); 00092 s.append(", "); 00093 s.append(toString(myEnergyMax)); 00094 s.append("]"); 00095 }
virtual bool pftools::SpaceVoxel::hcalValid | ( | ) | const [inline, virtual] |
Definition at line 55 of file SpaceVoxel.h.
References hcalValid_.
00055 { 00056 return hcalValid_; 00057 }
double pftools::SpaceVoxel::maxEnergy | ( | ) | const [inline] |
Definition at line 47 of file SpaceVoxel.h.
References myEnergyMax.
Referenced by operator()().
00047 { 00048 return myEnergyMax; 00049 }
double pftools::SpaceVoxel::minEnergy | ( | ) | const [inline] |
Definition at line 43 of file SpaceVoxel.h.
References myEnergyMin.
Referenced by operator()().
00043 { 00044 return myEnergyMin; 00045 }
bool pftools::SpaceVoxel::operator() | ( | const boost::shared_ptr< SpaceVoxel > & | sv1, | |
const boost::shared_ptr< SpaceVoxel > & | sv2 | |||
) |
bool SpaceVoxel::operator() | ( | const SpaceVoxel & | sv1, | |
const SpaceVoxel & | sv2 | |||
) |
Definition at line 97 of file SpaceVoxel.cc.
References maxEnergy(), and minEnergy().
00097 { 00098 if(sv1.minEnergy() < sv2.maxEnergy()) 00099 return true; 00100 00101 return false; 00102 }
void SpaceVoxel::print | ( | std::ostream & | s | ) | const |
Definition at line 65 of file SpaceVoxel.cc.
References ecalValid_, hcalValid_, myEnergyMax, myEnergyMin, myEtaMax, myEtaMin, myPhiMax, and myPhiMin.
Referenced by pftools::operator<<().
00065 { 00066 s << "SpaceVoxel: "; 00067 if (ecalValid_) 00068 s << "E"; 00069 if (hcalValid_) 00070 s << "H, "; 00071 s << "eta: ["<< myEtaMin << ", "<< myEtaMax << "]\t phi: ["<< myPhiMin 00072 << ". "<< myPhiMax << "]\t energy: ["<< myEnergyMin<< ", " 00073 << myEnergyMax << "]"; 00074 }
void pftools::SpaceVoxel::printMsg | ( | ) | [inline] |
Definition at line 61 of file SpaceVoxel.h.
References GenMuonPlsPt100GeV_cfg::cout.
00061 { 00062 std::cout << "Hello!\n"; 00063 }
std::ostream& operator<< | ( | std::ostream & | s, | |
const pftools::SpaceVoxel & | sv | |||
) | [friend] |
bool pftools::SpaceVoxel::ecalValid_ [private] |
Definition at line 84 of file SpaceVoxel.h.
Referenced by contains(), ecalValid(), getName(), print(), and SpaceVoxel().
bool pftools::SpaceVoxel::hcalValid_ [private] |
Definition at line 85 of file SpaceVoxel.h.
Referenced by contains(), getName(), hcalValid(), print(), and SpaceVoxel().
double pftools::SpaceVoxel::myEnergyMax [private] |
Definition at line 83 of file SpaceVoxel.h.
Referenced by containsEnergy(), getName(), maxEnergy(), and print().
double pftools::SpaceVoxel::myEnergyMin [private] |
Definition at line 82 of file SpaceVoxel.h.
Referenced by containsEnergy(), getName(), minEnergy(), and print().
double pftools::SpaceVoxel::myEtaMax [private] |
double pftools::SpaceVoxel::myEtaMin [private] |
double pftools::SpaceVoxel::myPhiMax [private] |
double pftools::SpaceVoxel::myPhiMin [private] |