Commit 64e94a28 authored by dauncey's avatar dauncey

Resolve merge conflict

parents 2aa896b7 5c701a05
......@@ -334,6 +334,9 @@ public:
DigNoise::setIrradiated(false);
DigNoise::resetScale();
//DigNoise::setScale(0.001);
DigHitMultiple::peakingTime(-1.0); // CMSSW
std::cout << "0.5 MIP in thickness 0 = " << DigHit::mipToLoAdc(0,0.5) << " ADC units" << std::endl;
std::cout << "0.5 MIP in thickness 1 = " << DigHit::mipToLoAdc(1,0.5) << " ADC units" << std::endl;
......
......@@ -412,7 +412,13 @@ public:
fMapPerWafer=false;
if(sAnal!=0) {
unsigned nDaqTh(1);
unsigned nTpgTh(2);
unsigned nSh(3);
unsigned nMp(0);
if(sAnal>=10000) {
/*
std::ostringstream sout;
sout << "AnalysisOccupancy" << std::setw(2) << std::setfill('0')
<< sAnal << ".cfg";
......@@ -425,6 +431,11 @@ public:
std::cout << " Argument parameter = " << xxx << std::endl;
BACKTRACE_AND_ASSERT(fin);
fin.close();
*/
nDaqTh=sAnal%10;
nTpgTh=(sAnal/10)%10;
nSh=(sAnal/100)%10;
nMp=(sAnal/1000)%10;
}
hNumberOfWafersVsLayer[0]=new TH1F((fName+"_NumberOfWafers0VsLayer").c_str(),
......@@ -461,6 +472,7 @@ public:
std::vector<std::string> sNse(numbers("Noise",3));
std::vector<std::string> sNum(numbers("MIPs",max(unsigned(kDaqCutHi),unsigned(kTpgCutHi))+1));
std::vector<std::string> sThk(numbers("Thick",3));
std::vector<std::string> sWz(numbers("Wafer",Geometry::kMaximumNumberOfWafersPerSextant+1));
hNumberOfCellTots=new TH2F((fName+"_NumberOfCellTots").c_str(),
";Layer;#rho (cm);Occupancy",
......@@ -686,7 +698,13 @@ public:
";Layer number;Wafer number;Maximum number of DAQ ADCs/wafer",
Geometry::kNumberOfLayers,0.0,Geometry::kNumberOfLayers,
Geometry::kMaximumNumberOfWafersPerSextant,0.0,Geometry::kMaximumNumberOfWafersPerSextant);
for(unsigned wz(0);wz<Geometry::kMaximumNumberOfWafersPerSextant;wz++) {
hDaqAdcPerWafer[n][i][wz]=new TH1F((fName+"_"+sNse[n]+sNum[i+1]+"Layer04"+sWz[wz]+"DaqAdcPerWafer").c_str(),
";Number of DAQ ADCs/wafer",
Geometry::kMaximumNumberOfSensorCellsPerWafer,0.0,Geometry::kMaximumNumberOfSensorCellsPerWafer);
}
hDaqAdcPerAsicVsAsicLayerA[n][i]=new TH2A((fName+"_"+sNse[n]+sNum[i+1]+"DaqAdcPerAsicVsAsicLayer").c_str(),
";Layer number;ASIC number;Average number of DAQ ADCs/ASIC",
Geometry::kNumberOfLayers,0.0,Geometry::kNumberOfLayers,
......@@ -958,7 +976,13 @@ public:
";Layer number;Wafer number;Maximum number of TPG hits/wafer",
Geometry::kNumberOfLayers,0.0,Geometry::kNumberOfLayers,
Geometry::kMaximumNumberOfWafersPerSextant,0.0,Geometry::kMaximumNumberOfWafersPerSextant);
for(unsigned wz(0);wz<Geometry::kMaximumNumberOfWafersPerSextant;wz++) {
hTpgHitPerWafer[n][i][wz]=new TH1F((fName+"_"+sNse[n]+sNum[i+1]+"Layer04"+sWz[wz]+"TpgHitPerWafer").c_str(),
";Number of TPG hits/wafer",
Geometry::kMaximumNumberOfTriggerCellsPerWafer,0.0,Geometry::kMaximumNumberOfTriggerCellsPerWafer);
}
hTpgHitPerAsicVsAsicLayerA[n][i]=new TH2A((fName+"_"+sNse[n]+sNum[i+1]+"TpgHitPerAsicVsAsicLayer").c_str(),
";Layer number;ASIC number;Average number of TPG hits/ASIC",
Geometry::kNumberOfLayers,0.0,Geometry::kNumberOfLayers,
......@@ -1294,11 +1318,21 @@ public:
}
std::cout << "Total links per endcap = " << totalLinks << std::endl;
Event::fDigHitDaqSelectorMipsCut[0]=0.4+0.1*nDaqTh;
Event::fDigHitDaqSelectorMipsCut[1]=0.4+0.1*nDaqTh;
Event::fDigHitDaqSelectorMipsCut[2]=0.4+0.1*nDaqTh;
Event::fDigHitTpgSelectorSigmasCut=3.0;
Event::fTrgHitSelectorMethod=2;
Event::fTrgHitSelectorMipsCut=2.0;
Event::fTrgHitSelectorMipsCut=1.0+0.5*nTpgTh;
DigHitMultiple::peakingTime(0.2*nSh);
// Depends on nMap
GeometryRawV1toAnaV10::fMethod=(nMp==2?1:0);
GeometryRawV1toAnaV10::fMapMethod=(nMp==0?0:1);
for(unsigned n(kNoiseLo);n<kNoiseHi;n++) {
if(n==0) {
DigNoise::setIrradiated(false);
......@@ -1377,6 +1411,10 @@ public:
std::ofstream foutAvg("PhilippeAvg.txt");
TH1F *hTpgHitsPerWaferDist=new TH1F((fName+"_TpgHitsPerWaferDist").c_str(),
";Average number of TPG hits/wafer",
Geometry::kMaximumNumberOfTriggerCellsPerWafer+1,0.0,Geometry::kMaximumNumberOfTriggerCellsPerWafer+1);
for(unsigned l(0);l<Geometry::kNumberOfLayers;l++) {
std::ostringstream soutAvg[Geometry::kMaximumNumberOfWafersPerSextant];
std::ostringstream soutMax[Geometry::kMaximumNumberOfWafersPerSextant];
......@@ -1410,7 +1448,9 @@ public:
h2[5]=hDaqAdcPerWaferVsWaferLayerX[kNoiseLo][kDaqCutLo]->Max();
h2[6]=hDaqBitPerWaferVsWaferLayerA[kNoiseLo][kDaqCutLo][2][1]->Avg();
h2[7]=hDaqBitPerWaferVsWaferLayerX[kNoiseLo][kDaqCutLo][2][1]->Max();
hTpgHitsPerWaferDist->Fill(h2[0]->GetBinContent(l+1,wZero+1));
soutAvg[wZero] << l;
if(l<10) soutAvg[wZero] << " ";
soutAvg[wZero] << std::setw(3) << wZero
......@@ -1756,8 +1796,13 @@ public:
double m(digHit.mips());
for(unsigned i(kDaqCutLo);i<kDaqCutHi;i++) {
/*
bool selected(m>=0.1*(i+1)); // Varying MIP cut
//bool selected(m>=0.5 && digHit.sigmas()>0.25*(i+1)); // 0.5 MIP cut and varying sigma cut
BACKTRACE_AND_ASSERT(selected==digHit.daqSelected());
*/
bool selected(digHit.daqSelected());
if(digHit.invalid()) {
BACKTRACE_AND_ASSERT(!selected);
......@@ -1839,9 +1884,12 @@ public:
}
for(unsigned i(kTpgCutLo);i<kTpgCutHi;i++) {
/*
bool selected(m>=0.5*(i+1)); // Varying MIP_T cut
if(i==3) BACKTRACE_AND_ASSERT(selected==trgHit.isSelected());
*/
bool selected(trgHit.isSelected());
if(selected) {
nAsicTpgHits[i]++;
......@@ -1975,6 +2023,7 @@ public:
// Wafers
hDaqAdcPerWaferVsWaferLayerA[j][i]->Fill(l,wZero,nWaferDaqAdcs[i]);
hDaqAdcPerWaferVsWaferLayerX[j][i]->Fill(l,wZero,nWaferDaqAdcs[i]);
if(l==4) hDaqAdcPerWafer[j][i][wZero]->Fill(nWaferDaqAdcs[i]);
for(unsigned m(0);m<kNumberOfDaqMethods;m++) {
for(unsigned x(0);x<2;x++) {
......@@ -1990,6 +2039,7 @@ public:
// Wafers
hTpgHitPerWaferVsWaferLayerA[j][i]->Fill(l,wZero,nWaferTpgHits[i]);
hTpgHitPerWaferVsWaferLayerX[j][i]->Fill(l,wZero,nWaferTpgHits[i]);
if(l==4) hTpgHitPerWafer[j][i][wZero]->Fill(nWaferTpgHits[i]);
// Loop over methods for bit encoding
for(unsigned m(0);m<kNumberOfTpgMethods;m++) {
......@@ -2291,6 +2341,7 @@ private:
TH2A *hDaqAdcPerWaferVsWaferLayerA[3][kDaqCutHi];
TH2X *hDaqAdcPerWaferVsWaferLayerX[3][kDaqCutHi];
TH1F *hDaqAdcPerWafer[3][kDaqCutHi][Geometry::kMaximumNumberOfWafersPerSextant];
TH2A *hDaqAdcPerAsicVsAsicLayerA[3][kDaqCutHi];
TH2X *hDaqAdcPerAsicVsAsicLayerX[3][kDaqCutHi];
......@@ -2360,6 +2411,7 @@ private:
TH2A *hTpgHitPerWaferVsWaferLayerA[3][kTpgCutHi];
TH2X *hTpgHitPerWaferVsWaferLayerX[3][kTpgCutHi];
TH1F *hTpgHitPerWafer[3][kDaqCutHi][Geometry::kMaximumNumberOfWafersPerSextant];
TH2A *hTpgHitPerAsicVsAsicLayerA[3][kTpgCutHi];
TH2X *hTpgHitPerAsicVsAsicLayerX[3][kTpgCutHi];
......
......@@ -384,21 +384,25 @@ public:
static void resetPeakingTime() {
peakingTime(0.4);
/*
// CMSSW values
fPeakingTime=0.1;
fWeightBx[0]=0.0;
fWeightBx[1]=0.0;
fWeightBx[2]=0.0;
fWeightBx[3]=0.004;
fWeightBx[4]=0.200;
fWeightBx[5]=1.000;
*/
}
static void peakingTime(double t) {
bool threeStage(true);
fPeakingTime=t;
// CMSSW values
if(fPeakingTime<0.0) {
fWeightBx[0]=0.0;
fWeightBx[1]=0.0;
fWeightBx[2]=0.0;
fWeightBx[3]=0.004;
fWeightBx[4]=0.200;
fWeightBx[5]=1.000;
return;
}
// CR-RC shaper
for(unsigned bx(0);bx<kNumberOfBx;bx++) {
if(fPeakingTime>0.0) {
unsigned dbx(kNumberOfBx-bx-1);
......@@ -406,6 +410,8 @@ public:
} else {
fWeightBx[bx]=(bx==(kNumberOfBx-1)?1.0:0.0);
}
if(threeStage) fWeightBx[bx]=fWeightBx[bx]*fWeightBx[bx];
}
}
......
......@@ -773,9 +773,11 @@ public:
for(unsigned l(0);l<Geometry::kNumberOfLayers;l++) {
for(unsigned w(0);w<Geometry::numberOfWafersPerLayer(l);w++) {
if(Geometry::validWafer(l,w)) {
unsigned sl(Geometry::numberOfSublayers(l,w)-1);
for(unsigned c(0);c<Geometry::numberOfSensorCellsPerWafer(l,w);c++) {
if(!vDigHit[e][l][w][c].invalid()) {
vDigHit[e][l][w][c].daqSelected(vDigHit[e][l][w][c].mips()>=fDigHitDaqSelectorMipsCut);
vDigHit[e][l][w][c].daqSelected(vDigHit[e][l][w][c].mips()>=fDigHitDaqSelectorMipsCut[sl]);
vDigHit[e][l][w][c].tpgSelected(vDigHit[e][l][w][c].sigmas()>=fDigHitTpgSelectorSigmasCut);
} else {
vDigHit[e][l][w][c].daqSelected(false);
......@@ -1366,17 +1368,19 @@ void print() const {
static void printStatics() {
std::cout << "Event::printStatics()" << std::endl
<< " fDigHitDaqSelectorMipsCut = " << fDigHitDaqSelectorMipsCut << std::endl
<< " fDigHitTpgSelectorSigmasCut = " << fDigHitTpgSelectorSigmasCut << std::endl
<< " fTrgHitSelectorMethod = " << fTrgHitSelectorMethod << std::endl
<< " fTrgHitSelectorMipsCut = " << fTrgHitSelectorMipsCut << std::endl
<< " fTrgC2dCreatorMethod = " << fTrgC2dCreatorMethod << std::endl
<< " fTrgC3dCreatorMethod = " << fTrgC3dCreatorMethod << std::endl
<< " fDigHitDaqSelectorMipsCut 100mu = " << fDigHitDaqSelectorMipsCut[0] << std::endl
<< " fDigHitDaqSelectorMipsCut 200mu = " << fDigHitDaqSelectorMipsCut[1] << std::endl
<< " fDigHitDaqSelectorMipsCut 300mu = " << fDigHitDaqSelectorMipsCut[2] << std::endl
<< " fDigHitTpgSelectorSigmasCut = " << fDigHitTpgSelectorSigmasCut << std::endl
<< " fTrgHitSelectorMethod = " << fTrgHitSelectorMethod << std::endl
<< " fTrgHitSelectorMipsCut = " << fTrgHitSelectorMipsCut << std::endl
<< " fTrgC2dCreatorMethod = " << fTrgC2dCreatorMethod << std::endl
<< " fTrgC3dCreatorMethod = " << fTrgC3dCreatorMethod << std::endl
<< std::endl;
}
static double fDigHitDaqSelectorMipsCut;
static double fDigHitDaqSelectorMipsCut[3];
static double fDigHitTpgSelectorSigmasCut;
static unsigned fTrgHitSelectorMethod;
......@@ -1449,7 +1453,8 @@ TH2F *hXY3d;
};
double Event::fDigHitDaqSelectorMipsCut=0.5;
//double Event::fDigHitDaqSelectorMipsCut[3]={0.5376,0.5230,0.5196}; // JBS: from CMSSW
double Event::fDigHitDaqSelectorMipsCut[3]={0.5,0.5,0.5};
double Event::fDigHitTpgSelectorSigmasCut=3.0;
unsigned Event::fTrgHitSelectorMethod=2;
......
......@@ -95,10 +95,10 @@ public:
return true;
}
protected:
static unsigned fMethod;
static unsigned fMapMethod;
protected:
GeometryCellMap fGcm;
};
......
......@@ -52,7 +52,7 @@ public:
kNumberOfSensorCellsInPhi=5,
kMaximumNumberOfPanelsPerSextant=17,
kMaximumNumberOfPanelsPerSextant=21,
kMaximumNumberOfPanelsPerLayer=6*kMaximumNumberOfPanelsPerSextant,
kMaximumNumberOfWafersPerSextant=80,
......@@ -1305,16 +1305,8 @@ public:
wPair[2]=std::pair<int,int>( 8,0);
wPair[3]=std::pair<int,int>(10,0);
std::cout << "LAYER " << l << " wPair.size() = " << wPair.size() << std::endl;
for(unsigned i(0);i<wPair.size();i++) {
std::cout << "LAYER " << l << " wPair[" << i << "] = "
<< wPair[i].first << ", " << wPair[i].second << std::endl;
//w=pairToWafer(l,wPair[i]);
//w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
HexInt2D h(wPair[i].first,wPair[i].second);
h.print();
w=hexInt2DToWafer(l,h);
std::cout << "LAYER " << l << " wafer = " << w << std::endl;
w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
if(w<0xffffffff) {
BACKTRACE_AND_ASSERT(validWafer(l,w));
vPanelToWafers[l][np[l]*6].push_back(w);
......@@ -1335,7 +1327,6 @@ public:
wPair[3]=std::pair<int,int>( 9,1);
for(unsigned i(0);i<wPair.size();i++) {
//w=pairToWafer(l,wPair[i]);
w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
if(w<0xffffffff) {
BACKTRACE_AND_ASSERT(validWafer(l,w));
......@@ -1647,14 +1638,20 @@ public:
np[l]=0;
wPair.resize(4);
wPair.resize(2);
wPair[0]=std::pair<int,int>( 4,0);
wPair[1]=std::pair<int,int>( 6,0);
wPair[2]=std::pair<int,int>( 8,0);
wPair[3]=std::pair<int,int>(10,0);
std::cout << "LAYER " << l << " wPair.size() = " << wPair.size() << std::endl;
for(unsigned i(0);i<wPair.size();i++) {
w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
std::cout << "LAYER " << l << " wPair[" << i << "] = "
<< wPair[i].first << ", " << wPair[i].second << std::endl;
//w=pairToWafer(l,wPair[i]);
//w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
HexInt2D h(wPair[i].first,wPair[i].second);
h.print();
w=hexInt2DToWafer(l,h);
std::cout << "LAYER " << l << " wafer = " << w << std::endl;
if(w<0xffffffff) {
BACKTRACE_AND_ASSERT(validWafer(l,w));
vPanelToWafers[l][np[l]*6].push_back(w);
......@@ -1668,13 +1665,12 @@ public:
np[l]++;
}
wPair.resize(4);
wPair.resize(2);
wPair[0]=std::pair<int,int>( 3,1);
wPair[1]=std::pair<int,int>( 5,1);
wPair[2]=std::pair<int,int>( 7,1);
wPair[3]=std::pair<int,int>( 9,1);
for(unsigned i(0);i<wPair.size();i++) {
//w=pairToWafer(l,wPair[i]);
w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
if(w<0xffffffff) {
BACKTRACE_AND_ASSERT(validWafer(l,w));
......@@ -1689,11 +1685,9 @@ public:
np[l]++;
}
wPair.resize(3);
wPair.resize(1);
wPair[0]=std::pair<int,int>( 4,2);
wPair[1]=std::pair<int,int>( 6,2);
wPair[2]=std::pair<int,int>( 8,2);
for(unsigned i(0);i<wPair.size();i++) {
w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
if(w<0xffffffff) {
......@@ -1709,10 +1703,93 @@ public:
np[l]++;
}
wPair.resize(3);
wPair.resize(1);
wPair[0]=std::pair<int,int>( 5,3);
wPair[1]=std::pair<int,int>( 7,3);
wPair[2]=std::pair<int,int>( 9,3);
for(unsigned i(0);i<wPair.size();i++) {
w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
if(w<0xffffffff) {
BACKTRACE_AND_ASSERT(validWafer(l,w));
vPanelToWafers[l][np[l]*6].push_back(w);
}
}
if(vPanelToWafers[l][np[l]*6].size()>0) {
std::cout << "LAYER " << l << " panel " << np[l]
<< " vPanelToWafers.size() = " << vPanelToWafers[l][np[l]*6].size()
<< " wPair.size() = " << wPair.size() << std::endl;
np[l]++;
}
wPair.resize(2);
wPair[0]=std::pair<int,int>( 8,0);
wPair[1]=std::pair<int,int>(10,0);
std::cout << "LAYER " << l << " wPair.size() = " << wPair.size() << std::endl;
for(unsigned i(0);i<wPair.size();i++) {
std::cout << "LAYER " << l << " wPair[" << i << "] = "
<< wPair[i].first << ", " << wPair[i].second << std::endl;
//w=pairToWafer(l,wPair[i]);
//w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
HexInt2D h(wPair[i].first,wPair[i].second);
h.print();
w=hexInt2DToWafer(l,h);
std::cout << "LAYER " << l << " wafer = " << w << std::endl;
if(w<0xffffffff) {
BACKTRACE_AND_ASSERT(validWafer(l,w));
vPanelToWafers[l][np[l]*6].push_back(w);
}
}
if(vPanelToWafers[l][np[l]*6].size()>0) {
std::cout << "LAYER " << l << " panel " << np[l]
<< " vPanelToWafers.size() = " << vPanelToWafers[l][np[l]*6].size()
<< " wPair.size() = " << wPair.size() << std::endl;
np[l]++;
}
wPair.resize(2);
wPair[0]=std::pair<int,int>( 7,1);
wPair[1]=std::pair<int,int>( 9,1);
for(unsigned i(0);i<wPair.size();i++) {
//w=pairToWafer(l,wPair[i]);
w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
if(w<0xffffffff) {
BACKTRACE_AND_ASSERT(validWafer(l,w));
vPanelToWafers[l][np[l]*6].push_back(w);
}
}
if(vPanelToWafers[l][np[l]*6].size()>0) {
std::cout << "LAYER " << l << " panel " << np[l]
<< " vPanelToWafers.size() = " << vPanelToWafers[l][np[l]*6].size()
<< " wPair.size() = " << wPair.size() << std::endl;
np[l]++;
}
wPair.resize(2);
wPair[0]=std::pair<int,int>( 6,2);
wPair[1]=std::pair<int,int>( 8,2);
for(unsigned i(0);i<wPair.size();i++) {
w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
if(w<0xffffffff) {
BACKTRACE_AND_ASSERT(validWafer(l,w));
vPanelToWafers[l][np[l]*6].push_back(w);
}
}
if(vPanelToWafers[l][np[l]*6].size()>0) {
std::cout << "LAYER " << l << " panel " << np[l]
<< " vPanelToWafers.size() = " << vPanelToWafers[l][np[l]*6].size()
<< " wPair.size() = " << wPair.size() << std::endl;
np[l]++;
}
wPair.resize(2);
wPair[0]=std::pair<int,int>( 7,3);
wPair[1]=std::pair<int,int>( 9,3);
for(unsigned i(0);i<wPair.size();i++) {
w=hexInt2DToWafer(l,HexInt2D(wPair[i].first,wPair[i].second));
......
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