#include <Calibration/Tools/interface/CalibrationCluster.h>
Public Types | |
typedef map< EBDetId, unsigned int > | CalibMap |
typedef CalibMap::value_type | pippo |
Public Member Functions | |
CalibrationCluster () | |
vector< EBDetId > | get3x3Id (EBDetId const &) |
vector< EBDetId > | get5x5Id (EBDetId const &) |
vector< float > | getEnergyVector (const EBRecHitCollection *, CalibMap &, vector< EBDetId > &, float &, int &) |
CalibMap | getMap (int, int, int, int) |
~CalibrationCluster () | |
Private Attributes | |
CalibMap | calibRegion |
vector< float > | energyVector |
vector< EBDetId > | Xtals3x3 |
vector< EBDetId > | Xtals5x5 |
Definition at line 15 of file CalibrationCluster.h.
typedef map<EBDetId,unsigned int> CalibrationCluster::CalibMap |
Definition at line 18 of file CalibrationCluster.h.
typedef CalibMap::value_type CalibrationCluster::pippo |
Definition at line 19 of file CalibrationCluster.h.
CalibrationCluster::CalibrationCluster | ( | ) |
CalibrationCluster::~CalibrationCluster | ( | ) |
Definition at line 53 of file CalibrationCluster.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), EBDetId::ETAPHIMODE, EBDetId::ieta(), EBDetId::iphi(), row, and Xtals3x3.
00053 { 00054 00055 Xtals3x3.clear(); 00056 00057 for (unsigned int icry=0;icry<9;icry++) 00058 { 00059 unsigned int row = icry / 3; 00060 unsigned int column= icry %3; 00061 00062 00063 try 00064 { 00065 Xtals3x3.push_back(EBDetId(maxHitId.ieta()+column-1,maxHitId.iphi()+row-1,EBDetId::ETAPHIMODE)); 00066 } 00067 catch ( ... ) 00068 { 00069 std::cout << "Cannot construct 3x3 matrix around EBDetId " << maxHitId << std::endl; 00070 } 00071 } 00072 00073 return Xtals3x3; 00074 }
Definition at line 16 of file CalibrationCluster.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), EBDetId::ETAPHIMODE, EBDetId::ieta(), EBDetId::iphi(), row, and Xtals5x5.
Referenced by ElectronCalibration::analyze().
00016 { 00017 00018 00019 Xtals5x5.clear(); 00020 00021 00022 // std::cout << "get5x5Id: max Containment crystal " << maxHitId.ic() << " eta " << maxHitId.ieta() << " phi " << maxHitId.iphi() << std::endl; 00023 00024 for (unsigned int icry=0;icry<25;icry++) 00025 { 00026 unsigned int row = icry / 5; 00027 unsigned int column= icry %5; 00028 // std::cout << "CalibrationCluster::icry = " << icry << std::endl; 00029 00030 int curr_eta=maxHitId.ieta() + column - (5/2); 00031 int curr_phi=maxHitId.iphi() + row - (5/2); 00032 00033 if (curr_eta * maxHitId.ieta() <= 0) {if (maxHitId.ieta() > 0) curr_eta--; else curr_eta++; } // JUMP over 0 00034 if (curr_phi < 1) curr_phi += 360; 00035 if (curr_phi > 360) curr_phi -= 360; 00036 00037 try 00038 { 00039 // Xtals5x5.push_back(EBDetId(maxHitId.ieta()+column-2,maxHitId.iphi()+row-2,EBDetId::ETAPHIMODE)); 00040 Xtals5x5.push_back(EBDetId(curr_eta,curr_phi,EBDetId::ETAPHIMODE)); 00041 } 00042 catch ( ... ) 00043 { 00044 std::cout << "Cannot construct 5x5 matrix around EBDetId " << maxHitId << std::endl; 00045 } 00046 } 00047 00048 return Xtals5x5; 00049 }
vector< float > CalibrationCluster::getEnergyVector | ( | const EBRecHitCollection * | hits, | |
CalibMap & | ReducedMap, | |||
vector< EBDetId > & | XstalsNxN, | |||
float & | outBoundEnergy, | |||
int & | nXtalsOut | |||
) |
Definition at line 110 of file CalibrationCluster.cc.
References relval_parameters_module::energy, energyVector, edm::SortedCollection< T, SORT >::find(), and it.
00111 { 00112 00113 energyVector.clear(); 00114 vector<EBDetId>::iterator it; 00115 00116 // std::cout << "Reduced Map Size =" << ReducedMap.size() << std::endl; 00117 // std::cout << "XstalsNxN Size =" << XstalsNxN.size() << std::endl; 00118 energyVector.resize(ReducedMap.size(),0.); 00119 00120 outBoundEnergy=0.; 00121 nXtalsOut=0; 00122 for(it=XstalsNxN.begin();it!=XstalsNxN.end();++it) 00123 { 00124 if(ReducedMap.find(*it) != ReducedMap.end()){ 00125 CalibMap::iterator it2 = ReducedMap.find(*it); 00126 00127 int icry = it2->second; 00128 00129 energyVector[icry]=(hits->find(*it))->energy(); 00130 00131 } else { 00132 00133 // std::cout << " Cell out of Reduced map: did you subtracted the cell energy from P ???" << std::endl; 00134 outBoundEnergy+=(hits->find(*it))->energy(); 00135 nXtalsOut++; 00136 } 00137 } 00138 00139 00140 00141 return energyVector; 00142 00143 }
CalibrationCluster::CalibMap CalibrationCluster::getMap | ( | int | minEta, | |
int | maxEta, | |||
int | minPhi, | |||
int | maxPhi | |||
) |
Definition at line 79 of file CalibrationCluster.cc.
References calibRegion, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), eta, EBDetId::ETAPHIMODE, and phi.
Referenced by ElectronCalibration::beginJob().
00079 { 00080 00081 calibRegion.clear(); 00082 int rowSize=maxEta-minEta+1; 00083 int columnSize=maxPhi-minPhi+1; 00084 int reducedSize=rowSize*columnSize; 00085 00086 00087 for (int icry=0;icry<reducedSize;icry++) 00088 { 00089 unsigned int eta = minEta + icry/columnSize; 00090 unsigned int phi = minPhi + icry%columnSize; 00091 00092 00093 try 00094 { 00095 calibRegion.insert(pippo(EBDetId(eta,phi,EBDetId::ETAPHIMODE),icry)); 00096 } 00097 catch ( ... ) 00098 { 00099 std::cout << "Cannot construct full matrix !!! " << std::endl; 00100 } 00101 } 00102 00103 return calibRegion; 00104 00105 }
CalibMap CalibrationCluster::calibRegion [private] |
vector<float> CalibrationCluster::energyVector [private] |
vector<EBDetId> CalibrationCluster::Xtals3x3 [private] |
vector<EBDetId> CalibrationCluster::Xtals5x5 [private] |