Commit b833511d authored by dauncey's avatar dauncey

Add OOT pileup (but seems to need further debugging

parent 914d7a6a
......@@ -415,9 +415,10 @@ public:
unsigned nDaqTh(1);
unsigned nTpgTh(2);
unsigned nSh(3);
unsigned nPw(3);
unsigned nMp(0);
if(sAnal>=10000) {
if(sAnal>=100000) {
/*
std::ostringstream sout;
sout << "AnalysisOccupancy" << std::setw(2) << std::setfill('0')
......@@ -435,7 +436,8 @@ public:
nDaqTh=sAnal%10;
nTpgTh=(sAnal/10)%10;
nSh=(sAnal/100)%10;
nMp=(sAnal/1000)%10;
nPw=(sAnal/1000)%10;
nMp=(sAnal/10000)%10;
}
hNumberOfWafersVsLayer[0]=new TH1F((fName+"_NumberOfWafers0VsLayer").c_str(),
......@@ -656,6 +658,10 @@ public:
// ADC
hDaqPrePerLayerVsLayerA[n]=new TH1A((fName+"_"+sNse[n]+"DaqPrePerLayerVsLayer").c_str(),
";Layer number;Number of previous ADC hits/layer",
Geometry::kNumberOfLayers,0.0,Geometry::kNumberOfLayers);
for(unsigned i(kDaqCutLo);i<kDaqCutHi;i++) {
hDaqAdcValues[n][i]=new TH1D((fName+"_"+sNse[n]+sNum[i+1]+"DaqAdcValues").c_str(),
";ADC values",
......@@ -1327,7 +1333,14 @@ public:
Event::fTrgHitSelectorMethod=2;
Event::fTrgHitSelectorMipsCut=1.0+0.5*nTpgTh;
DigHitMultiple::peakingTime(0.2*nSh);
DigHitMultiple::rcPower(nPw);
if(nSh<=5) DigHitMultiple::peakingTime(0.2*nSh);
else {
if(nSh==6) {DigHitMultiple::peakingTime( 8.4/25.0);DigHitMultiple::rcPower(1);}
if(nSh==7) {DigHitMultiple::peakingTime(13.5/25.0);DigHitMultiple::rcPower(2);}
if(nSh==8) {DigHitMultiple::peakingTime(17.6/25.0);DigHitMultiple::rcPower(3);}
if(nSh==9) {DigHitMultiple::peakingTime(21.2/25.0);DigHitMultiple::rcPower(4);}
}
// Depends on nMap
GeometryRawV1toAnaV10::fMethod=(nMp==2?1:0);
......@@ -1385,8 +1398,18 @@ public:
}
}
fPout.open("PhilippeDump.txt");
BACKTRACE_AND_ASSERT(fPout);
for(unsigned e(0);e<Geometry::kNumberOfEndcaps;e++) {
for(unsigned l(0);l<Geometry::kNumberOfLayers;l++) {
for(unsigned w(0);w<Geometry::numberOfWafersPerLayer(l);w++) {
if(Geometry::validWafer(l,w)) {
for(unsigned sc(0);sc<Geometry::numberOfSensorCellsPerWafer(l,w);sc++) {
previousMips[e][l][w][sc]=0.0;
}
}
}
}
}
}
virtual ~AnalysisOccupancy() {
......@@ -1595,6 +1618,7 @@ public:
unsigned nLayerDaqTots(0);
unsigned nLayerDaqToas(0);
unsigned nLayerDaqAdcs[kDaqCutHi];
unsigned nLayerDaqPres(0);
unsigned nLayerDaqBits[kDaqCutHi][kNumberOfDaqMethods][3];
for(unsigned i(kDaqCutLo);i<kDaqCutHi;i++) {
nLayerDaqAdcs[i]=0;
......@@ -1827,8 +1851,11 @@ public:
nPanelDaqAdcs[i]++;
nLayerDaqAdcs[i]++;
nHgcalDaqAdcs[i]++;
if(previousMips[e][l][w][sc]>=2.5) nLayerDaqPres++;
}
}
previousMips[e][l][w][sc]=m;
}
// Do everything as a function of the ADC cuts
......@@ -2183,6 +2210,8 @@ public:
hDaqToaPerLayerVsLayerX[j]->Fill(l,nLayerDaqToas);
// Do everything as a function of the ADC cuts
hDaqPrePerLayerVsLayerA[j]->Fill(l,nLayerDaqPres);
for(unsigned i(kDaqCutLo);i<kDaqCutHi;i++) {
hDaqAdcPerLayer[j][i][l]->Fill(nLayerDaqAdcs[i]);
hDaqAdcPerLayerVsLayer[j][i]->Fill(l,nLayerDaqAdcs[i]);
......@@ -2270,10 +2299,10 @@ public:
private:
unsigned fEvents;
std::ofstream fPout;
bool fMapPerWafer;
double previousMips[Geometry::kNumberOfEndcaps][Geometry::kNumberOfLayers][Geometry::kMaximumNumberOfWafersPerLayer][Geometry::kMaximumNumberOfSensorCellsPerWafer];
TH1F *hNumberOfWafersVsLayer[3];
TH1F *hRatioOfWafersVsLayer[3];
TH1F *hNumberOfLinksVsLayer;
......@@ -2346,6 +2375,8 @@ private:
TH2A *hDaqAdcPerAsicVsAsicLayerA[3][kDaqCutHi];
TH2X *hDaqAdcPerAsicVsAsicLayerX[3][kDaqCutHi];
TH1A *hDaqPrePerLayerVsLayerA[3];
TH1F *hDaqAdcPerLayer[3][kDaqCutHi][Geometry::kNumberOfLayers];
TH2F *hDaqAdcPerLayerVsLayer[3][kDaqCutHi];
TH1A *hDaqAdcPerLayerVsLayerA[3][kDaqCutHi];
......
......@@ -386,13 +386,10 @@ public:
peakingTime(0.4);
}
static void peakingTime(double t) {
bool threeStage(true);
fPeakingTime=t;
static void setWeights() {
// CMSSW values
if(fPeakingTime<0.0) {
if(fPeakingTime<0.0 || fRcPower==0) {
fWeightBx[0]=0.0;
fWeightBx[1]=0.0;
fWeightBx[2]=0.0;
......@@ -411,15 +408,26 @@ public:
fWeightBx[bx]=(bx==(kNumberOfBx-1)?1.0:0.0);
}
if(threeStage) fWeightBx[bx]=fWeightBx[bx]*fWeightBx[bx];
fWeightBx[bx]=pow(fWeightBx[bx],fRcPower);
}
}
static void peakingTime(double t) {
fPeakingTime=t;
setWeights();
}
static void rcPower(unsigned p) {
fRcPower=p;
setWeights();
}
static void printStatics() {
std::cout << "DigHitMultiple::printStatics()" << std::endl
<< " Number of BX saved = " << kNumberOfBx << std::endl
<< " Peaking time in units of BX = " << fPeakingTime
<< ", in units of ns = " << 25.0*fPeakingTime << std::endl
<< " CR-RC^N with N = " << fRcPower << std::endl
<< " Weights per BX =";
for(unsigned bx(0);bx<kNumberOfBx;bx++) {
std::cout << " " << fWeightBx[bx];
......@@ -432,6 +440,7 @@ public:
private:
static double fWeightBx[kNumberOfBx];
static double fPeakingTime;
static unsigned fRcPower;
float fGaussian;
float fSimHitDepositSignal;
......@@ -441,6 +450,7 @@ private:
unsigned DigHitMultiple::fBxNumber=0;
double DigHitMultiple::fPeakingTime=1.0; // 25 ns in units of BX
unsigned DigHitMultiple::fRcPower=1;
double DigHitMultiple::fWeightBx[kNumberOfBx]={
(1+5.0/fPeakingTime)*exp(-5.0/fPeakingTime),
(1+4.0/fPeakingTime)*exp(-4.0/fPeakingTime),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment