Commit 6757535c by dauncey

### Add multiple arguments to trgAnalysis but still need event start to be implemented

parent 6ffeb278
Pipeline #20038 skipped
No preview for this file type
 ... ... @@ -78,6 +78,38 @@ But since the solution is defined by $Ma=v$, then $a^T M a = a^T v$. Hence \mathrm{RMS}^2_\mathrm{min} = \frac{1}{N} \sum_e T_e^2 - a^T M a = \frac{1}{N} \sum_e T_e^2 - v^T M^{-1} v The above can be extended slightly, which may improve the energy response linearity as well as the RMS. The energy estimation for the event (i.e. the first equation in this section) can be generally considered to be a polynomial in the $d_{e,i}$, but with the quadratic and higher terms neglected. However, it also neglects any constant term. A more general expression would then be to add another coefficient $b$ to give E_e = b + \sum_i a_i d_{e,i} The easiest way to handle this is to allow the index $i$ to go one higher than previously, specifically change from $i=0,27$ to $i=0,28$ and then define $a_{28}=b$ and $d_{e,28}=1$. This means the expression simplifies to E_e = \sum_{i=0}^{28} a_i d_{e,i} and so an identical calculation to previously holds, simply with the index running over a larger range. Explicitly, the matrix $M$ is now $29\times 29$ with the extra elements being M_{i,28} = M_{28,i} = \frac{1}{N} \sum_e d_{e,28}d_{e,i} = \frac{1}{N} \sum_e d_{e,i} and M_{28,28} = \frac{1}{N} \sum_e d_{e,28}d_{e,28} = 1 while the extra element in $v$ is v_{28} = \frac{1}{N} \sum_e T_e d_{e,28} = \frac{1}{N} \sum_e T_e \section{Units} Keeping quantities to 16-bit integers. ... ...
 ... ... @@ -14,8 +14,9 @@ class AnalysisBase { public: AnalysisBase(const std::string &sName="Base") // ctor : fName(sName), fTFileHandler(fName) { AnalysisBase(const std::string &sName="Base", const std::string &sRoot="") // ctor : fName(sName), fTFileHandler(fName+(sRoot==""?sRoot:"_"+sRoot)) { fEventSelect=0; fPrintLevel=0; ... ...
 ... ... @@ -132,7 +132,7 @@ public: nWafer[Geometry::numberOfSublayers(l,w)-1]++; fWaferRho[l][w]=Geometry::waferPoint(l,w).rho(); fWaferRho[l][w]=Geometry::waferPoint(1,l,w).rho(); for(unsigned c(0);c
 ... ... @@ -322,50 +322,107 @@ public: (sTitle.str()+";Rho (cm);Energy difference (GeV)").c_str(), 200,0.0,200.0); } TH1F *hFC000=new TH1F("FC000",";Layer;Coefficient",28,0.0,28.0); TH1F *hFC200=new TH1F("FC200",";Layer;Coefficient",28,0.0,28.0); // SimHits; all 1k events fitted with 0 or 200 PU //if(true) { // 0 PU fFitCoeff[0]=5.66014; fFitCoeff[1]=4.19688; fFitCoeff[2]=0.307786; fFitCoeff[3]=2.37461; fFitCoeff[4]=2.27252; fFitCoeff[5]=0.264792; fFitCoeff[6]=0.882856; fFitCoeff[7]=0.710141; fFitCoeff[8]=1.40916; fFitCoeff[9]=1.49218; fFitCoeff[10]=1.19712; fFitCoeff[11]=1.05946; fFitCoeff[12]=1.34921; fFitCoeff[13]=0.960359; fFitCoeff[14]=0.817771; fFitCoeff[15]=1.28552; fFitCoeff[16]=1.62068; fFitCoeff[17]=1.56386; fFitCoeff[18]=1.25811; fFitCoeff[19]=0.799995; fFitCoeff[20]=0.749894; fFitCoeff[21]=1.1302; fFitCoeff[22]=1.76742; fFitCoeff[23]=1.09919; fFitCoeff[24]=1.29918; fFitCoeff[25]=0.043092; fFitCoeff[26]=2.54908; fFitCoeff[27]=1.0863; fFitCoeff[28]=0; fFitCoeff[29]=0; fFitCoeff[30]=0; fFitCoeff[31]=0; fFitCoeff[32]=0; fFitCoeff[33]=0; fFitCoeff[34]=0; fFitCoeff[35]=0; fFitCoeff[36]=0; fFitCoeff[37]=0; fFitCoeff[38]=0; fFitCoeff[39]=0; for(unsigned i(0);i<28;i++) { hFC000->SetBinContent(i+1,fFitCoeff[i]); } // SimHits; all 1k events fitted with 200 PU fFitCoeff[0]=-2.24876; fFitCoeff[1]=1.28108; fFitCoeff[2]=1.01436; fFitCoeff[3]=2.49601; fFitCoeff[4]=1.98179; fFitCoeff[5]=1.20344; fFitCoeff[6]=1.00278; fFitCoeff[7]=0.695715; fFitCoeff[8]=1.19054; fFitCoeff[9]=1.68355; fFitCoeff[10]=0.800412; fFitCoeff[11]=1.32589; fFitCoeff[12]=0.91138; fFitCoeff[13]=1.3035; fFitCoeff[14]=0.689325; fFitCoeff[15]=1.25186; fFitCoeff[16]=1.46017; fFitCoeff[17]=1.68828; fFitCoeff[18]=0.939856; fFitCoeff[19]=0.682892; fFitCoeff[20]=0.434451; fFitCoeff[21]=1.63003; fFitCoeff[22]=1.94675; fFitCoeff[23]=2.39824; fFitCoeff[24]=1.11453; fFitCoeff[25]=-0.842631; fFitCoeff[26]=-0.687827; fFitCoeff[27]=-0.360403; fFitCoeff[28]=0; fFitCoeff[29]=0; fFitCoeff[30]=0; fFitCoeff[31]=0; fFitCoeff[32]=0; fFitCoeff[33]=0; fFitCoeff[34]=0; fFitCoeff[35]=0; fFitCoeff[36]=0; fFitCoeff[37]=0; fFitCoeff[38]=0; fFitCoeff[39]=0; // } else { // 200 PU fFitCoeff[0]=-2.24876; fFitCoeff[1]=1.28108; fFitCoeff[2]=1.01436; fFitCoeff[3]=2.49601; fFitCoeff[4]=1.98179; fFitCoeff[5]=1.20344; fFitCoeff[6]=1.00278; fFitCoeff[7]=0.695715; fFitCoeff[8]=1.19054; fFitCoeff[9]=1.68355; fFitCoeff[10]=0.800412; fFitCoeff[11]=1.32589; fFitCoeff[12]=0.91138; fFitCoeff[13]=1.3035; fFitCoeff[14]=0.689325; fFitCoeff[15]=1.25186; fFitCoeff[16]=1.46017; fFitCoeff[17]=1.68828; fFitCoeff[18]=0.939856; fFitCoeff[19]=0.682892; fFitCoeff[20]=0.434451; fFitCoeff[21]=1.63003; fFitCoeff[22]=1.94675; fFitCoeff[23]=2.39824; fFitCoeff[24]=1.11453; fFitCoeff[25]=-0.842631; fFitCoeff[26]=-0.687827; fFitCoeff[27]=-0.360403; fFitCoeff[28]=0; fFitCoeff[29]=0; fFitCoeff[30]=0; fFitCoeff[31]=0; fFitCoeff[32]=0; fFitCoeff[33]=0; fFitCoeff[34]=0; fFitCoeff[35]=0; fFitCoeff[36]=0; fFitCoeff[37]=0; fFitCoeff[38]=0; fFitCoeff[39]=0; for(unsigned i(0);i<28;i++) { hFC200->SetBinContent(i+1,fFitCoeff[i]); } // } // SimHits: all 1k events in SinglePhotonPt35_simHit_1kev fSgShape[0]=0.00261114; ... ...
 ... ... @@ -20,127 +20,153 @@ class AnalysisSimHit : public AnalysisBase { public: AnalysisSimHit(const std::string &sName="AnalysisSimHit") : AnalysisBase(sName) { hGenVertexX=new TH1F((sName+"_GenVertexX").c_str(), AnalysisSimHit(const std::string &sRoot="") : AnalysisBase("AnalysisSimHit",sRoot) { hGenVertexX=new TH1F((fName+"_GenVertexX").c_str(), ";Vertex x (cm)", 100,0.0,1.0); hGenVertexY=new TH1F((sName+"_GenVertexY").c_str(), hGenVertexY=new TH1F((fName+"_GenVertexY").c_str(), ";Vertex y (cm)", 100,0.0,1.0); hGenVertexZ=new TH1F((sName+"_GenVertexZ").c_str(), hGenVertexZ=new TH1F((fName+"_GenVertexZ").c_str(), ";Vertex z (cm)", 100,-100.0,100.0); hGenVertexT=new TH1F((sName+"_GenVertexT").c_str(), hGenVertexT=new TH1F((fName+"_GenVertexT").c_str(), ";Vertex c#tau (cm)", 100,-100.0,100.0); hMipsVsLayer[0]=new TH2F((fName+"_"+"MipsVsLayer0").c_str(), ";Layer;MIPs", 52,0.0,52.0,100,0.0,10.0); hMipsVsLayerP[0]=new TProfile((fName+"_"+"MipsVsLayer0P").c_str(), ";Layer;MIPs", 52,0.0,52.0,0.0,10.0); hMipsVsLayer[1]=new TH2F((fName+"_"+"MipsVsLayer1").c_str(), ";Layer;MIPs", 52,0.0,52.0,100,0.0,100.0); hMipsVsLayerP[1]=new TProfile((fName+"_"+"MipsVsLayer1P").c_str(), ";Layer;MIPs", 52,0.0,52.0,0.0,100.0); hMipsVsLayer[2]=new TH2F((fName+"_"+"MipsVsLayer2").c_str(), ";Layer;MIPs", 52,0.0,52.0,100,0.0,1000.0); hMipsVsLayerP[2]=new TProfile((fName+"_"+"MipsVsLayer2P").c_str(), ";Layer;MIPs", 52,0.0,52.0,0.0,1000.0); hMipsVsLayer[3]=new TH2F((fName+"_"+"MipsVsLayer3").c_str(), ";Layer;MIPs", 52,0.0,52.0,100,0.0,10000.0); hMipsVsLayerP[3]=new TProfile((fName+"_"+"MipsVsLayer3P").c_str(), ";Layer;MIPs", 52,0.0,52.0,0.0,10000.0); for(unsigned l(0);l<=Geometry::kNumberOfLayers;l++) { hHitNumber[l]=new TH1F((sName+sLayerLabel[l]+"HitNumber").c_str(), hHitNumber[l]=new TH1F((fName+sLayerLabel[l]+"HitNumber").c_str(), (sLayerTitle[l]+";Number").c_str(), 100,0.0,l sEta(numbers("EtaBin",20)); for(unsigned i(0);i<20;i++) { hBhEtaBin[i]=new TH1F((sName+"_"+sEta[i]+"TkEta").c_str(), hBhEtaBin[i]=new TH1F((fName+"_"+sEta[i]+"TkEta").c_str(), ";Track #eta", 150,1.0,1.5); } ... ... @@ -229,6 +255,8 @@ public: } unsigned nSimHitLayer(0); double simHitMips(0.0); for(unsigned w(0);wFill(nSimHitLayer); hHitNumber[Geometry::kNumberOfLayers]->Fill(nSimHit); hMipsVsLayer[0]->Fill(l,simHitMips); hMipsVsLayerP[0]->Fill(l,simHitMips); hMipsVsLayer[1]->Fill(l,simHitMips); hMipsVsLayerP[1]->Fill(l,simHitMips); hMipsVsLayer[2]->Fill(l,simHitMips); hMipsVsLayerP[2]->Fill(l,simHitMips); hMipsVsLayer[3]->Fill(l,simHitMips); hMipsVsLayerP[3]->Fill(l,simHitMips); } for(unsigned l(0);l& vSimHbh(event.simHbhs(e,l,h,f)); ... ... @@ -317,6 +356,8 @@ public: nSimHitLayer+=vSimHbh.size(); for(unsigned i(0);iFill(vSimHbh[i].deposit()); ... ... @@ -352,6 +393,15 @@ public: } } } hMipsVsLayer[0]->Fill(l+40,simHitMips); hMipsVsLayerP[0]->Fill(l+40,simHitMips); hMipsVsLayer[1]->Fill(l+40,simHitMips); hMipsVsLayerP[1]->Fill(l+40,simHitMips); hMipsVsLayer[2]->Fill(l+40,simHitMips); hMipsVsLayerP[2]->Fill(l+40,simHitMips); hMipsVsLayer[3]->Fill(l+40,simHitMips); hMipsVsLayerP[3]->Fill(l+40,simHitMips); } } ... ... @@ -366,6 +416,9 @@ protected: TH1F *hGenVertexZ; TH1F *hGenVertexT; TH2F *hMipsVsLayer[4]; TProfile *hMipsVsLayerP[4]; TH1F *hHitNumber[Geometry::kNumberOfLayers+1]; TH2F *hScaledYVsX[Geometry::kNumberOfLayers+1]; ... ...
 #ifndef AnalysisTrgHit_HH #define AnalysisTrgHit_HH #include #include #include #include #include #include "TH1F.h" #include "TH2F.h" #include "TProfile.h" #include "DigNoise.hh" #include "AnalysisBase.hh" class AnalysisTrgHit : public AnalysisBase { public: AnalysisTrgHit(const std::string &sName="AnalysisTrgHit") : AnalysisBase(sName) { for(unsigned l(0);l<=Geometry::kNumberOfLayers;l++) { hHitNumber[l]=new TH1F((sName+"_"+sLayerLabel[l]+"HitNumber").c_str(), (sLayerTitle[l]+";Number").c_str(), 100,0.0,1000.0); hSelMips[l]=new TH1F((sName+"_"+sLayerLabel[l]+"SelMips").c_str(), (sLayerTitle[l]+";Deposited energy (MIPs)").c_str(), 100,0.0,1000.0); hUnsMips[l]=new TH1F((sName+"_"+sLayerLabel[l]+"UnsMips").c_str(), (sLayerTitle[l]+";Deposited energy (MIPs)").c_str(), 100,0.0,1000.0); hSimGeV[l]=new TH1F((sName+"_"+sLayerLabel[l]+"SimGeV").c_str(), (sLayerTitle[l]+";Deposited energy (GeV)").c_str(), 100,0.0,2.0e-4); hSimFc[l][0]=new TH1F((sName+"_"+sLayerLabel[l]+"SimFc0").c_str(), (sLayerTitle[l]+";Charge (fC)").c_str(), 100,0.0,20.0); hSimFc[l][1]=new TH1F((sName+"_"+sLayerLabel[l]+"SimFc1").c_str(), (sLayerTitle[l]+";Charge (fC)").c_str(), 100,0.0,500.0); hSimFc[l][2]=new TH1F((sName+"_"+sLayerLabel[l]+"SimFc2").c_str(), (sLayerTitle[l]+";Charge (fC)").c_str(), 250,0.0,2500.0); hSimFc[l][3]=new TH1F((sName+"_"+sLayerLabel[l]+"SimFc3").c_str(), (sLayerTitle[l]+";log_{10}[Charge (fC)]").c_str(), 200,0.0,4.0); hSimFc[l][4]=new TH1F((sName+"_"+sLayerLabel[l]+"SimFc4").c_str(), (sLayerTitle[l]+";log_{10}[Charge (fC)];Energy weighted entries").c_str(), 200,0.0,4.0); hSimMips[l]=new TH1F((sName+"_"+sLayerLabel[l]+"SimMips").c_str(), (sLayerTitle[l]+";MIPs").c_str(), 100,0.0,10.0); hNoise[l]=new TH1F((sName+"_"+sLayerLabel[l]+"Noise").c_str(), (sLayerTitle[l]+";Noise (fC)").c_str(), 100,-2.5,2.5); hRhoVsSimGeV[l]=new TH2F((sName+"_"+sLayerLabel[l]+"RhoVsSimGeV").c_str(), (sLayerTitle[l]+";Deposited energy (GeV);#rho (cm)").c_str(), 100,0.0,2.0e-4,100,0.0,200.0); hRhoVsSimFc[l]=new TH2F((sName+"_"+sLayerLabel[l]+"RhoVsSimFc").c_str(), (sLayerTitle[l]+";Charge (fC);#rho (cm)").c_str(), 100,0.0,20.0,100,0.0,200.0); hRhoVsSimMips[l]=new TH2F((sName+"_"+sLayerLabel[l]+"RhoVsSimMips").c_str(), (sLayerTitle[l]+";MIPs;#rho (cm)").c_str(), 100,0.0,10.0,100,0.0,200.0); hNoiseVsRho[l]=new TH2F((sName+"_"+sLayerLabel[l]+"NoiseVsRho").c_str(), (sLayerTitle[l]+";#rho (cm);Noise (fC)").c_str(), 100,0.0,200.0,100,-2.5,2.5); hAdcVsFcA[l]=new TH2F((sName+"_"+sLayerLabel[l]+"AdcVsFcA").c_str(), (sLayerTitle[l]+";Charge (fC);Data value").c_str(), 100,0.0,10.0,100,0.0,100.0); hAdcVsFcB[l]=new TH2F((sName+"_"+sLayerLabel[l]+"AdcVsFcB").c_str(), (sLayerTitle[l]+";Charge (fC);Data value").c_str(), 120,0.0,120.0,120,0.0,1200.0); hTotVsFcA[l]=new TH2F((sName+"_"+sLayerLabel[l]+"TotVsFcA").c_str(), (sLayerTitle[l]+";Charge (fC);Data value").c_str(), 100,0.0,500.0,80,0.0,80.0); hTotVsFcB[l]=new TH2F((sName+"_"+sLayerLabel[l]+"TotVsFcB").c_str(), (sLayerTitle[l]+";Charge (fC);Data value").c_str(), 120,0.0,12000.0,120,0.0,4800.0); hResultVsFc[l][0]=new TH2F((sName+"_"+sLayerLabel[l]+"Result0VsFc").c_str(), (sLayerTitle[l]+";Charge (fC);Data value").c_str(),