diff --git a/macros/CCEScan/deplVphiN_normalized.C b/macros/CCEScan/deplVphiN_normalized.C index 5711e5d..5ddf58a 100644 --- a/macros/CCEScan/deplVphiN_normalized.C +++ b/macros/CCEScan/deplVphiN_normalized.C @@ -43,8 +43,8 @@ // -d detector (TT/IT) // -s set 0: all; // 1: TT [125-160] V / IT [ 75-150] V; -// 1: TT [160-220] V / IT [150-220] V; -// 1: TT [220-280] V / IT [220-250] V; +// 2: TT [160-220] V / IT [150-220] V; +// 3: TT [220-280] V / IT [220-250] V; // Voltage values are the initial depletion voltage values measured after production @@ -117,9 +117,12 @@ TFile* f_deplV = TFile::Open(fn_deplV.Data()); TFile* f_fill = TFile::Open(fn_fill.Data()); TFile* f_sector = TFile::Open(fn_sector.Data()); - const Int_t nRTT = 4; // Define ranges of radii + const Int_t nRTT = 4; Double_t rTT[nRTT] = {-1.0,75.0,45.0,40.0}; + // Define ranges of radii + const Int_t nRIT = 2; + Double_t rIT[nRIT] = {-1.0,175.0}; // Get information about the luminosity and the TVectorD* vp_fill = (TVectorD*)f_fill->Get("v_fill"); TVectorD* vp_lumi7 = (TVectorD*)f_fill->Get("v_lumi7"); @@ -133,35 +136,48 @@ TVectorD v_lumi7 = *vp_lumi7; TVectorD v_lumi8 = *vp_lumi8; TVectorD v_lumi13 = *vp_lumi13; - // Get numbers of available read-out sectors and corresponding initial depletion voltage values + + // Get vector of read-out sectors numbers and corresponding initial depletion voltage values TVectorD* vp_sector = (TVectorD*)f_deplV->Get(Form("v_sector_%s",lay.Data())); TVectorD* vp_vdepl = (TVectorD*)f_deplV->Get(Form("v_vdepl_%s",lay.Data())); if (!vp_sector || !vp_vdepl) { - Error("deplVphiN","Depletion Voltage vectors are not available"); + Error("deplVphiN","Initial depletion voltage vector or sector number vector not available"); return EXIT_FAILURE; } TVectorD v_sector = *vp_sector; TVectorD v_vdepl = *vp_vdepl; Int_t effnR = nRTT; + + /* --- Comment this bit out (Elena) + // No radius is taken into account in case of IT + + --- */ if (det.EqualTo("IT")) { - effnR = 1; + // effnR = 1; + effnR = nRIT; } // We plot only one prediction... not one per sector! // Define the starting depletion voltage for the predictions - double startV = 200.0; + // TT + double startV = 200.0; if (set==1) { - startV = 160.0; + startV = 155.0; + }else if(set==2){ + startV = 190.0; }else if(set==3){ - startV = 240.0; + startV = 250.0; } + // IT if (det.EqualTo("IT")) { startV = 100.0; if (set==1) { startV = 80.0; + }else if(set==2){ + startV = 180.0; }else if(set==3){ - startV = 120.0; + startV = 230.0; } } // Prediction calculation based on the stable damage part in the Hamburg model @@ -230,18 +246,20 @@ std::vector v_phiN_e_r_mid; std::vector v_phiN_e_r_high; // Boundaries for sectors sets - double vTop = 280.0; double vBottom = 125.0; double v1Bound = 160.0; double v2Bound = 220.0; + double vTop = 280.0; if (det.EqualTo("IT")) { - vTop = 250.0; vBottom = 75.0; v1Bound = 150.0; v2Bound = 220.0; + vTop = 250.0; } - double vMax = vTop; - double vMin = vBottom; + double vMax = vTop; + double vMin = vBottom; + + // Select range according to the chosen set if (set==1) { vMax = v1Bound; }else if(set==2){ @@ -273,13 +291,16 @@ TString vn_data(Form("%s/%s/%d/%d/v_volt_val%d", det.Data(),lay.Data(),sector,fill,val)); // Add radius postfix + // NB: Wwth k=0 it takes the whole sector! if (rTT[k]>0.0) { s_rad = Form("%d",(int)rTT[k]); vn_sector_flux += "_r"+s_rad; vn_flux7_val += "_r"+s_rad; vn_flux8_val += "_r"+s_rad; + vn_flux13_val += "_r"+s_rad; vn_flux7_err += "_r"+s_rad; vn_flux8_err += "_r"+s_rad; + vn_flux13_err += "_r"+s_rad; vn_data += "_r"+s_rad; } // Extract fluence vectors from the file @@ -291,9 +312,9 @@ TVectorD* vp_flux8_err = (TVectorD*)f_sector->Get(vn_flux8_err.Data()); TVectorD* vp_flux13_err = (TVectorD*)f_sector->Get(vn_flux13_err.Data()); if (!vp_sector_flux || - !vp_flux7_val || !vp_flux7_err || + !vp_flux7_val || !vp_flux7_err || !vp_flux13_val || !vp_flux13_err || - !vp_flux8_val || !vp_flux8_err) { + !vp_flux8_val || !vp_flux8_err) { Error("deplVphiN","Missing flux information for radius = %6.2f mm",rTT[k]>0.0?rTT[k]:2000.0); continue; } @@ -312,22 +333,22 @@ TVectorD v_flux13_err = *vp_flux13_err; TVectorD v_data = *vp_data; int i_flux = getClosestIndex(v_sector_flux,(double)sector); - double flux7_val = v_flux7_val(i_flux); - double flux7_err = v_flux7_err(i_flux); - double flux8_val = v_flux8_val(i_flux); - double flux8_err = v_flux8_err(i_flux); + double flux7_val = v_flux7_val(i_flux); + double flux7_err = v_flux7_err(i_flux); + double flux8_val = v_flux8_val(i_flux); + double flux8_err = v_flux8_err(i_flux); double flux13_val = v_flux13_val(i_flux); double flux13_err = v_flux13_err(i_flux); - double lumi7 = v_lumi7(i); - double lumi8 = v_lumi8(i); - double lumi13 = v_lumi13(i); + double lumi7 = v_lumi7(i); + double lumi8 = v_lumi8(i); + double lumi13 = v_lumi13(i); double vdepl_prod = v_vdepl(j); - double vdepl_val = v_data(0); - double vdepl_err = v_data(1); - double vdepl_sys = v_data(2); - double vdepl_tot = vdepl_err; - double phiN_val = STTool::FLUKAConvFac; - double phiN_err = STTool::FLUKAConvFac; + double vdepl_val = v_data(0); + double vdepl_err = v_data(1); + double vdepl_sys = v_data(2); + double vdepl_tot = vdepl_err; + double phiN_val = STTool::FLUKAConvFac; + double phiN_err = STTool::FLUKAConvFac; phiN_val *= (flux7_val*lumi7 + flux8_val*lumi8 + flux13_val*lumi13); phiN_err *= (flux7_err*lumi7 + flux8_err*lumi8 + flux13_err*lumi13); // Define maximal and minimal Vdepl values to be drawn @@ -341,10 +362,12 @@ Warning("deplVphiN","Too high or low uncertainty on V_depl"); continue; } + // Remove points outside the plot range if (vdepl_val>plotMax || vdepl_valvMax || vdepl_prod<=vMin) { continue; } @@ -365,67 +388,94 @@ vdepl_val,vdepl_err,vdepl_sys); Printf(" V_depl,prod = %6.2f V", vdepl_prod); + //// Define data point in plot (NOT NEEDED) //TMarker* m_res = new TMarker(phiN_val,vdepl_val,20); //TLine* l_hor = new TLine(phiN_val-phiN_err,vdepl_val, // phiN_val+phiN_err,vdepl_val); //TLine* l_ver = new TLine(phiN_val,vdepl_val-vdepl_err, // phiN_val,vdepl_val+vdepl_err); + // Add data to the proper vectors and normalize + + //----------------------------------------- for TT if (det.EqualTo("TT")) { - if (vdepl_prod>v2Bound) { - if (rTT[k]>0.0) { + if (vdepl_prod>v2Bound) { // Sectors with higher Vdepl after production + if (rTT[k]>0.0) { // Inner circles v_vdepl_v_r_high.push_back(vdepl_val/vdepl_prod); v_vdepl_e_r_high.push_back(vdepl_tot/vdepl_prod); v_phiN_v_r_high.push_back(phiN_val); v_phiN_e_r_high.push_back(phiN_err); - }else{ + }else{ // Whole sectors v_vdepl_v_norm_high.push_back(vdepl_val/vdepl_prod); v_vdepl_e_norm_high.push_back(vdepl_tot/vdepl_prod); v_phiN_v_norm_high.push_back(phiN_val); v_phiN_e_norm_high.push_back(phiN_err); } - }else if(vdepl_prod>v1Bound) { - if (rTT[k]>0.0) { + }else if(vdepl_prod>v1Bound) { // Sectors with lower Vdepl after production + if (rTT[k]>0.0) { // Inner circles v_vdepl_v_r_mid.push_back(vdepl_val/vdepl_prod); v_vdepl_e_r_mid.push_back(vdepl_tot/vdepl_prod); v_phiN_v_r_mid.push_back(phiN_val); v_phiN_e_r_mid.push_back(phiN_err); - }else{ + }else{ // Whole sectors v_vdepl_v_norm_mid.push_back(vdepl_val/vdepl_prod); v_vdepl_e_norm_mid.push_back(vdepl_tot/vdepl_prod); v_phiN_v_norm_mid.push_back(phiN_val); v_phiN_e_norm_mid.push_back(phiN_err); } - }else{ - if (rTT[k]>0.0) { + }else{ // Sectors with lowest Vdepl after production + if (rTT[k]>0.0) { // Inner circles v_vdepl_v_r_low.push_back(vdepl_val/vdepl_prod); v_vdepl_e_r_low.push_back(vdepl_tot/vdepl_prod); v_phiN_v_r_low.push_back(phiN_val); v_phiN_e_r_low.push_back(phiN_err); - }else{ + }else{ // Whole sectors v_vdepl_v_norm_low.push_back(vdepl_val/vdepl_prod); v_vdepl_e_norm_low.push_back(vdepl_tot/vdepl_prod); v_phiN_v_norm_low.push_back(phiN_val); v_phiN_e_norm_low.push_back(phiN_err); } } + + //----------------------------------------- for IT }else{ - if (vdepl_prod>v2Bound) { - v_vdepl_v_norm_high.push_back(vdepl_val/vdepl_prod); - v_vdepl_e_norm_high.push_back(vdepl_tot/vdepl_prod); - v_phiN_v_norm_high.push_back(phiN_val); - v_phiN_e_norm_high.push_back(phiN_err); - }else if(vdepl_prod>v1Bound) { - v_vdepl_v_norm_mid.push_back(vdepl_val/vdepl_prod); - v_vdepl_e_norm_mid.push_back(vdepl_tot/vdepl_prod); - v_phiN_v_norm_mid.push_back(phiN_val); - v_phiN_e_norm_mid.push_back(phiN_err); - }else{ - v_vdepl_v_norm_low.push_back(vdepl_val/vdepl_prod); - v_vdepl_e_norm_low.push_back(vdepl_tot/vdepl_prod); - v_phiN_v_norm_low.push_back(phiN_val); - v_phiN_e_norm_low.push_back(phiN_err); + if (vdepl_prod>v2Bound) { // Sectors with higher Vdepl after production + if (rIT[k]>0.0) { // Inner circles + v_vdepl_v_r_high.push_back(vdepl_val/vdepl_prod); + v_vdepl_e_r_high.push_back(vdepl_tot/vdepl_prod); + v_phiN_v_r_high.push_back(phiN_val); + v_phiN_e_r_high.push_back(phiN_err); + }else{ // Whole sectors + v_vdepl_v_norm_high.push_back(vdepl_val/vdepl_prod); + v_vdepl_e_norm_high.push_back(vdepl_tot/vdepl_prod); + v_phiN_v_norm_high.push_back(phiN_val); + v_phiN_e_norm_high.push_back(phiN_err); + } + }else if(vdepl_prod>v1Bound) { // Sectors with lower Vdepl after production + if (rIT[k]>0.0) { // Inner circles + v_vdepl_v_r_mid.push_back(vdepl_val/vdepl_prod); + v_vdepl_e_r_mid.push_back(vdepl_tot/vdepl_prod); + v_phiN_v_r_mid.push_back(phiN_val); + v_phiN_e_r_mid.push_back(phiN_err); + }else{ // Whole sectors + v_vdepl_v_norm_mid.push_back(vdepl_val/vdepl_prod); + v_vdepl_e_norm_mid.push_back(vdepl_tot/vdepl_prod); + v_phiN_v_norm_mid.push_back(phiN_val); + v_phiN_e_norm_mid.push_back(phiN_err); + } + }else{ // Sectors with lowest Vdepl after production + if (rIT[k]>0.0) { // Inner circles + v_vdepl_v_r_low.push_back(vdepl_val/vdepl_prod); + v_vdepl_e_r_low.push_back(vdepl_tot/vdepl_prod); + v_phiN_v_r_low.push_back(phiN_val); + v_phiN_e_r_low.push_back(phiN_err); + }else{ // Whole sectors + v_vdepl_v_norm_low.push_back(vdepl_val/vdepl_prod); + v_vdepl_e_norm_low.push_back(vdepl_tot/vdepl_prod); + v_phiN_v_norm_low.push_back(phiN_val); + v_phiN_e_norm_low.push_back(phiN_err); + } } } // end if (IT or TT) } // end loop on radii diff --git a/macros/CCEScan/landauFit.C b/macros/CCEScan/landauFit.C index 7c0bcf3..bc6ddff 100644 --- a/macros/CCEScan/landauFit.C +++ b/macros/CCEScan/landauFit.C @@ -194,12 +194,20 @@ if (radius == 45) { radmax = 45.0; } else if (radius == 75) { - radmax = 75.0; radmin = 45.0; + radmax = 75.0; + } else if (radius == 175) { + // This setting is the only one for the IT + radmin = 0.0; + radmax = 175.0; } else if (radius == 40) { // Placeholder for "rest of the sector" // r < 40 mm has too little statistics anyways! radmin = 75.0; + if (strcmp(det.Data(),"IT")==0) { + // The only radius for the IT is 175 mm + radmin = 175.0; + } radmax = 2000.0; } } @@ -212,6 +220,8 @@ Info("landauFit","Analyse: "); Printf(" Sector: %d",sector); Printf(" Radius: %4.2f mm",radius); + Printf(" Rad min: %4.2f mm",radmin); + Printf(" Rad max: %4.2f mm",radmax); Printf(" Fill: %d",fill); Printf(" Detector: %s",det.Data()); Printf(" Layer: %s",lay.Data()); diff --git a/macros/runCond/fluenceExtract.C b/macros/runCond/fluenceExtract.C index f2ad0a0..1eb529c 100755 --- a/macros/runCond/fluenceExtract.C +++ b/macros/runCond/fluenceExtract.C @@ -78,11 +78,14 @@ // Executable method int fluenceExtract(int argc, char* argv[]){ - double radius = 2000.0; + double radius = -10.0; + double radmin = 0.0; + double radmax = 2000.0; bool useRadius = false; TString det("TT"); for (int i=1; i%f/10 && (TMath::Sqrt(x*x+y*y)<%f/10)", radmin, radmax); } t_hit->Draw("y:x>>h_hit7",c_hit,"goff"); @@ -232,8 +260,8 @@ 1,h_hit8->GetNbinsY(), flux8_e); flux13_v = h_hit13->IntegralAndError(1,h_hit13->GetNbinsX(), - 1,h_hit13->GetNbinsY(), - flux13_e); + 1,h_hit13->GetNbinsY(), + flux13_e); if (TMath::IsNaN(flux7_v)) { flux7_v = 0.0; @@ -304,4 +332,4 @@ Info("fluenceExtract","Results written to %s",fn_out.Data()); return EXIT_SUCCESS; -} \ No newline at end of file +}