--- calo/flight/FQLOOK/macros/FCaloQLOOK.cxx 2006/05/29 13:15:49 1.11 +++ calo/flight/FQLOOK/macros/FCaloQLOOK.cxx 2006/07/17 08:51:11 1.12 @@ -1,12 +1,14 @@ // // Check for possible errors and shows raw distribution of variables coming from the DSP (no calibrations needed) - Emiliano Mocchiutti // -// FCaloQLOOK.c version 1.09 (2006-05-29) +// FCaloQLOOK.c version 1.11 (2006-07-17) // // The only input needed is the path to the directory created by YODA for the data file you want to analyze. // // Changelog: // +// 1.09 - 1.11 (2006-07-17): Adapted to flight conditions. +// // 1.07 - 1.09 (2006-05-29): Fixed bug in output filename when input is not in the form DW_YYMMDD_NNN. Bug in latchup alarm not coming from the status word, fixed. // // 1.06 - 1.07 (2006-05-23): Don't print warning in case of latchup not recognized from the status word, fixed. Added "expert" figures from 21 to 28 which appears only in the @@ -112,7 +114,10 @@ Float_t ctshitthr = 0.65; Float_t cbasethr = 0.95; Float_t cdexythr = 0.995; + //Float_t cdexythr = 0.90; Float_t cdexycthr = 0.95; + Float_t h1rth = 0.90; + Int_t calevnth = 13; // pamela::calorimeter::CalorimeterEvent *ce = 0; pamela::EventHeader *eh = 0; @@ -198,9 +203,10 @@ hdiff->SetBit(TH1F::kCanRebin); Baseline = new TH1F("C9","baselines",100,0,3); Baseline->SetBit(TH1F::kCanRebin); - Dexy = new TH1F("C12","dexy",100,0.,37000.); - Dexyc = new TH1F("C10","dexyc",100,0,3); - Dexyc->SetBit(TH1F::kCanRebin); + Dexy = new TH1F("C12","dexy",100,0.,10000.); + Dexy->SetBit(TH1F::kCanRebin); + Dexyc = new TH1F("C10","dexyc",100,-100.,37000.); +// Dexyc->SetBit(TH1F::kCanRebin); Calstriphit = new TH1F("C11","calstriphit[1:4]",100,0.,200.); calev01 = new TH1F("C3","|calevnum(1)-calevnum(2)|",100,0,1); @@ -310,6 +316,8 @@ Float_t headc = 0.; Float_t headco = 0.; Bool_t h1rcheck = false; + Int_t h1rin = 0; + Int_t h1rout = 0; Int_t intshit = 0; Int_t outtshit = 0; Int_t incshit = 0; @@ -345,9 +353,12 @@ headco = headc; headc = ph->GetCounter(); obt = ph->GetOrbitalTime(); - calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])); - calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])); - calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])); + if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++; + if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++; + if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])) ) calevn3++; + // calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])); + // calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])); + // calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])); calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1]))); calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3]))); calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3]))); @@ -596,30 +607,39 @@ trshit += rshit[k][kk]; }; }; - Calstriphit->Fill(cshit); - if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ - incshit++; - } else { - outcshit++; - }; - if ( tshit>0 ) h1->Fill(tshit); - if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ - intshit++; - } else { - outtshit++; + if (isCOMP || isFULL){ + Calstriphit->Fill(cshit); + // if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ + if ( (cshit > 10 && cshit < 100) ){ + incshit++; + } else { + outcshit++; + }; + // + if ( tshit>0 ) h1->Fill(tshit); + // if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ + if ( (tshit > 10 && tshit < 100) ){ + intshit++; + } else { + outtshit++; + }; }; if ( trshit>0 ) { h1r->Fill(trshit); if ( trshit < 4210 ){ - h1rcheck = true; + h1rout++; // printf("ma come... trshit %i \n",trshit); + } else { + h1rin++; }; }; if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000); i++; }; printf("\n"); - + if ( (float)h1rout/((float)h1rin+(float)h1rout) > h1rth ){ + h1rcheck = true; + }; // // output figures, first sheet: // @@ -685,20 +705,20 @@ h1->Draw(); // h1max = h1->GetMaximum()*1.05; - Double_t xc[4] = {0.,25.,25.,0.}; + Double_t xc[4] = {10.,100.,100.,10.}; Double_t yc[4] = {0.,0.,h1max,h1max}; banda1 = new TPolyLine(4,xc,yc); banda1->SetLineColor(5); banda1->SetFillColor(5); banda1->SetLineWidth(1); banda1->Draw("fSAME"); - Double_t xd[4] = {40.,80.,80.,40.}; - Double_t yd[4] = {0.,0.,h1max,h1max}; - banda2 = new TPolyLine(4,xd,yd); - banda2->SetLineColor(5); - banda2->SetFillColor(5); - banda2->SetLineWidth(1); - banda2->Draw("fSAME"); + // Double_t xd[4] = {40.,80.,80.,40.}; + // Double_t yd[4] = {0.,0.,h1max,h1max}; + // banda2 = new TPolyLine(4,xd,yd); + // banda2->SetLineColor(5); + // banda2->SetFillColor(5); + // banda2->SetLineWidth(1); + //banda2->Draw("fSAME"); h1->Draw("SAME"); // figura->cd(); @@ -735,20 +755,20 @@ h1->SetYTitle("Number of events"); h1->Draw(); h1max = h1->GetMaximum()*1.05; - Double_t xe[4] = {0.,25.,25.,0.}; + Double_t xe[4] = {10.,100.,100.,10.}; Double_t ye[4] = {0.,0.,h1max,h1max}; banda1 = new TPolyLine(4,xe,ye); banda1->SetLineColor(5); banda1->SetFillColor(5); banda1->SetLineWidth(1); banda1->Draw("fSAME"); - Double_t xf[4] = {40.,80.,80.,40.}; - Double_t yf[4] = {0.,0.,h1max,h1max}; - banda2 = new TPolyLine(4,xf,yf); - banda2->SetLineColor(5); - banda2->SetFillColor(5); - banda2->SetLineWidth(1); - banda2->Draw("fSAME"); + // Double_t xf[4] = {40.,80.,80.,40.}; + // Double_t yf[4] = {0.,0.,h1max,h1max}; + // banda2 = new TPolyLine(4,xf,yf); + // banda2->SetLineColor(5); + // banda2->SetFillColor(5); + // banda2->SetLineWidth(1); + // banda2->Draw("fSAME"); h1->Draw("SAME"); }; if ( trshit !=0 ) { @@ -778,7 +798,7 @@ }; }; if ( !errorfull ) { - if ( calevn1 || calevn2 || calevn3 ) { + if ( calevn1 > calevnth || calevn2 > calevnth || calevn3 > calevnth ) { pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.24,0.98,45); pd2 = new TPad("pd2","This is pad2",0.26,0.51,0.49,0.98,45); pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.24,0.49,45); @@ -953,24 +973,25 @@ Dexyc->Draw("SAME"); // pd3->cd(); +// gPad->SetLogy(); Calstriphit->SetXTitle("Number of hit"); Calstriphit->SetYTitle("Number of events"); Calstriphit->Draw(); h1max = Calstriphit->GetMaximum()*1.05; - Double_t xg[4] = {0.,25.,25.,0.}; + Double_t xg[4] = {10.,100.,100.,10.}; Double_t yg[4] = {0.,0.,h1max,h1max}; banda1 = new TPolyLine(4,xg,yg); banda1->SetLineColor(5); banda1->SetFillColor(5); banda1->SetLineWidth(1); banda1->Draw("fSAME"); - Double_t xh[4] = {40.,80.,80.,40.}; - Double_t yh[4] = {0.,0.,h1max,h1max}; - banda2 = new TPolyLine(4,xh,yh); - banda2->SetLineColor(5); - banda2->SetFillColor(5); - banda2->SetLineWidth(1); - banda2->Draw("fSAME"); + // Double_t xh[4] = {40.,80.,80.,40.}; + // Double_t yh[4] = {0.,0.,h1max,h1max}; + // banda2 = new TPolyLine(4,xh,yh); + // banda2->SetLineColor(5); + // banda2->SetFillColor(5); + // banda2->SetLineWidth(1); + // banda2->Draw("fSAME"); Calstriphit->Draw("SAME"); // pd4->cd(); @@ -1283,7 +1304,7 @@ errore << "Missing section: " << ver[i][j]; errore << " time(s)"; t->DrawLatex(2.,50.,errore.str().c_str()); - check = true; + if ( ver[i][j] > 3 ) check = true; } if (j == 10) { errore.str(""); @@ -1297,7 +1318,7 @@ errore << "CRC error (data): " << ver[i][j]; errore << " time(s)"; t->DrawLatex(2.,38.,errore.str().c_str()); - check = true; + if ( ver[i][j] > 10 ) check = true; } if (j == 12) { errore.str("");