#include <RecoTracker/TkMSParametrization/interface/MSLayersKeeperX0AtEta.h>
Public Member Functions | |
virtual void | init (const edm::EventSetup &iSetup) |
virtual const MSLayersAtAngle & | layers (float cotTheta) const |
MSLayersKeeperX0AtEta () | |
virtual | ~MSLayersKeeperX0AtEta () |
Private Member Functions | |
float | eta (int idxBin) const |
int | idxBin (float eta) const |
void | setX0 (std::vector< MSLayer > &, float eta, const SumX0AtEtaDataProvider &) const |
Private Attributes | |
bool | isInitialised |
float | theDeltaEta |
int | theHalfNBins |
std::vector< MSLayersAtAngle > | theLayersData |
Friends | |
class | MSLayersKeeperX0Averaged |
Definition at line 9 of file MSLayersKeeperX0AtEta.h.
MSLayersKeeperX0AtEta::MSLayersKeeperX0AtEta | ( | ) | [inline] |
virtual MSLayersKeeperX0AtEta::~MSLayersKeeperX0AtEta | ( | ) | [inline, virtual] |
float MSLayersKeeperX0AtEta::eta | ( | int | idxBin | ) | const [private] |
Definition at line 16 of file MSLayersKeeperX0AtEta.cc.
References theDeltaEta, and theHalfNBins.
Referenced by init(), and layers().
00017 { return (idxBin+0.5-theHalfNBins)*theDeltaEta; }
int MSLayersKeeperX0AtEta::idxBin | ( | float | eta | ) | const [private] |
Definition at line 20 of file MSLayersKeeperX0AtEta.cc.
References e, int, max, theDeltaEta, and theHalfNBins.
Referenced by layers().
00021 { 00022 float ieta = eta/theDeltaEta; 00023 if ( fabs(ieta) >= theHalfNBins - 1.e-3) 00024 return (eta>0) ? max(2*theHalfNBins-1,0) : 0; 00025 else 00026 return int(ieta+theHalfNBins); 00027 }
void MSLayersKeeperX0AtEta::init | ( | const edm::EventSetup & | iSetup | ) | [virtual] |
Reimplemented from MSLayersKeeper.
Definition at line 30 of file MSLayersKeeperX0AtEta.cc.
References eta(), gen_hydjet_hard_muon_trigger_cfg::etaMax, MSLayersAtAngle::findLayer(), MSLayersKeeper::getDataX0(), isInitialised, it, layers(), layout, parsecf::pyparsing::line(), max, MultipleScatteringX0Data::maxEta(), MultipleScatteringX0Data::nBinsEta(), MSLayersKeeper::setDataX0(), setX0(), python::multivaluedict::sort(), theDeltaEta, theHalfNBins, theLayersData, MSLayer::DataX0::x0, and z.
Referenced by MSLayersKeeperX0Averaged::init().
00031 { 00032 if (isInitialised) return; 00033 isInitialised = true; 00034 const float BIG = 99999.; 00035 00036 // set size from data file 00037 MultipleScatteringX0Data msX0data; 00038 theHalfNBins = msX0data.nBinsEta(); 00039 float etaMax = msX0data.maxEta(); 00040 theDeltaEta = (theHalfNBins!=0) ? etaMax/theHalfNBins : BIG; 00041 00042 theLayersData = vector<MSLayersAtAngle>(max(2*theHalfNBins, 1)); 00043 MultipleScatteringGeometry layout(iSetup); 00044 for (int idxbin = 0; idxbin < 2*theHalfNBins; idxbin++) { 00045 float etaValue = eta(idxbin); 00046 float cotTheta = sinh(etaValue); 00047 00048 vector<MSLayer> layers = layout.detLayers(etaValue,0,iSetup); 00049 vector<MSLayer> tmplay = layout.otherLayers(etaValue,iSetup); 00050 layers.insert(layers.end(),tmplay.begin(),tmplay.end()); 00051 sort(layers.begin(), layers.end()); 00052 setX0(layers, etaValue, msX0data); 00053 theLayersData[idxbin] = MSLayersAtAngle(layers); 00054 PixelRecoPointRZ zero(0.,0.); 00055 PixelRecoLineRZ line( zero, cotTheta); 00056 vector<MSLayer>::iterator it; 00057 for (it = layers.begin(); it != layers.end(); it++) { 00058 float x0 = getDataX0(*it).x0; 00059 float sumX0D = theLayersData[idxbin].sumX0D(zero, 00060 it->crossing(line).first); 00061 setDataX0(*it, DataX0(x0, sumX0D, cotTheta)); 00062 theLayersData[idxbin].update(*it); 00063 } 00064 } 00065 00066 // add layers not seen from nominal vertex but crossed if 00067 // vertex seperated from nominal by less than 3 sigma 00068 for (int idxbin = 0; idxbin < 2*theHalfNBins; idxbin++) { 00069 float etaValue = eta(idxbin); 00070 for (int isign=-1; isign <=1; isign+=2) { 00071 float z = isign*15.9; //3 sigma from zero 00072 const MSLayersAtAngle & layersAtAngle = theLayersData[idxbin]; 00073 vector<MSLayer> candidates = layout.detLayers( etaValue, z,iSetup); 00074 vector<MSLayer>::iterator it; 00075 for (it = candidates.begin(); it != candidates.end(); it++) { 00076 if (layersAtAngle.findLayer(*it)) continue; 00077 const MSLayer * found = 0; 00078 int bin = idxbin; 00079 while(!found) { 00080 bin--; if (bin < 0) break; 00081 found = theLayersData[bin].findLayer(*it); 00082 } 00083 bin = idxbin; 00084 while(!found) { 00085 bin++; if (bin > 2*theHalfNBins-1) break; 00086 found = theLayersData[bin].findLayer(*it); 00087 } 00088 if (found) theLayersData[idxbin].update(*found); 00089 } 00090 } 00091 } 00092 00093 // cout << "LAYERS, size=: "<<theLayersData.size()<< endl; 00094 /* 00095 for (int idxbin = 0; idxbin <= theHalfNBins; idxbin+=25) { 00096 float etaValue = eta(idxbin); 00097 const MSLayersAtAngle & layers= theLayersData[idxbin]; 00098 cout << "ETA: "<< etaValue <<" (bin:"<<idxbin<<") #layers:" 00099 <<layers.size()<<endl; 00100 layers.print(); 00101 } 00102 for (int idxbin = 2*theHalfNBins-1; idxbin > theHalfNBins; idxbin-=25) { 00103 float etaValue = eta(idxbin); 00104 const MSLayersAtAngle & layers= theLayersData[idxbin]; 00105 cout << "ETA: "<< etaValue <<" (bin:"<<idxbin<<") #layers:" 00106 <<layers.size()<<endl; 00107 layers.print(); 00108 } 00109 */ 00110 }
const MSLayersAtAngle & MSLayersKeeperX0AtEta::layers | ( | float | cotTheta | ) | const [virtual] |
Implements MSLayersKeeper.
Definition at line 9 of file MSLayersKeeperX0AtEta.cc.
References eta(), idxBin(), and theLayersData.
Referenced by init(), and MSLayersKeeperX0Averaged::init().
00010 { 00011 float eta = asinh(cotTheta); 00012 return theLayersData[idxBin(eta)]; 00013 }
void MSLayersKeeperX0AtEta::setX0 | ( | std::vector< MSLayer > & | , | |
float | eta, | |||
const SumX0AtEtaDataProvider & | ||||
) | const [private] |
Referenced by init().
friend class MSLayersKeeperX0Averaged [friend] |
Definition at line 25 of file MSLayersKeeperX0AtEta.h.
bool MSLayersKeeperX0AtEta::isInitialised [private] |
float MSLayersKeeperX0AtEta::theDeltaEta [private] |
int MSLayersKeeperX0AtEta::theHalfNBins [private] |
Definition at line 23 of file MSLayersKeeperX0AtEta.h.
Referenced by eta(), idxBin(), init(), and MSLayersKeeperX0Averaged::init().
std::vector<MSLayersAtAngle> MSLayersKeeperX0AtEta::theLayersData [private] |
Definition at line 24 of file MSLayersKeeperX0AtEta.h.
Referenced by init(), MSLayersKeeperX0Averaged::init(), and layers().