9 if (isInitialised)
return;
12 MSLayersKeeperX0AtEta layersX0Eta;
13 layersX0Eta.init(iSetup);
15 vector<MSLayer> allLayers =
geom.detLayers(iSetup);
16 vector<MSLayer>::iterator it;
17 for (
int i=-1;
i<=1;
i++) {
19 vector<MSLayer> tmpLayers =
geom.otherLayers(
eta,iSetup);
20 vector<MSLayer>::const_iterator ic;
21 for (ic = tmpLayers.begin(); ic != tmpLayers.end(); ic++) {
22 it =
find(allLayers.begin(), allLayers.end(), *ic);
23 if (it == allLayers.end()) allLayers.push_back(*ic);
29 for (it = allLayers.begin(); it != allLayers.end(); it++) {
31 it->range().mean()/it->position()
32 : it->position()/it->range().mean();
36 for (
int ibin = 0; ibin < 2*layersX0Eta.theHalfNBins; ibin++) {
39 if (aLayer) { nbins++; sumX0 += getDataX0(*aLayer).
x0; }
41 if ( nbins==0) nbins=1;
43 float hrange= (it->range().max()-it->range().min())/2.;
46 float cot1 = it->position()/(it->range().mean()-hrange/2);
47 float cot2 = it->position()/(it->range().mean()+hrange/2);
48 const MSLayer * aLayer1 = layersX0Eta.layers(cot1).findLayer(*it);
49 const MSLayer * aLayer2 = layersX0Eta.layers(cot1).findLayer(*it);
50 float sum1 = aLayer1 ? aLayer1->
sumX0D(cot1) : 0.;
51 float sum2 = aLayer2 ? aLayer2->
sumX0D(cot2) : 0.;
52 float slope = (sum2-sum1)/(1/cot2-1/cot1);
53 float sumX0D = sum1 + slope*(1/cotTheta-1/cot1);
54 dataX0 = DataX0(sumX0/nbins, sumX0D, cotTheta);
55 dataX0.setForwardSumX0DSlope(slope);
59 for (
int i=0;
i<nb;
i++) {
60 float cot = (it->range().mean()+(2*
i+1-nb)*hrange/nb)/it->position();
62 const MSLayer * aLayer = layersX0Eta.layers(cot).findLayer(*it);
63 if (aLayer) sumX0D += aLayer->
sumX0D(cot) *
sqrt(sin);
65 dataX0 = DataX0(sumX0/nbins, sumX0D/nb, 0);
67 setDataX0(*it, dataX0);
static const double slope[3]
Sin< T >::type sin(const T &t)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
float sumX0D(float cotTheta) const dso_hidden
float x0(float cotTheta) const dso_hidden
const MSLayer * findLayer(const MSLayer &layer) const