19 #include "TpcSimIonisationTrack.h"
25 #include "TRootEmbeddedCanvas.h"
26 #include "TGListBox.h"
57 if (plane != NULL )plane->
print();
116 Int_t nCl = clArray->GetEntries();
125 for(Int_t icl = 0; icl<nCl; icl++){
127 Double_t q = cluster->
GetQ();
130 if(type==0)
continue;
132 if(plane==1)
continue;
137 for(Int_t icl = 0; icl<nCl; icl++){
139 Double_t q = cluster->
GetQ();
142 if(type==0 || plane==1)
continue;
143 qmync+=((q-(
qmyn/nTmp))*(q-(
qmyn/nTmp)));
145 qsig=TMath::Sqrt((qmync/(nTmp-1)));
201 for(Int_t i = 0; i<nMCtr; i++){
206 Double_t xx = track->
GetX0();
207 Double_t yy = track->
GetY0();
208 Double_t zz = track->
GetZ0();
214 hxyz->Fill(xx,yy,-zz);
229 for(Int_t i = 0; i<nIonTr; i++){
236 for(Int_t j = 0; j<nPoints; j++){
238 Double_t Ne = point->
GetNe();
243 for(Int_t k=0; k<nPoints; k++){
245 Double_t Ne = point->
GetNe();
246 emync+=(Ne-(
emyn/nPoints))*(Ne-(
emyn/nPoints));
248 esig = TMath::Sqrt((emync/(nPoints-1)));
264 Int_t nCl = clArray->GetEntries();
266 for(Int_t zz = 0; zz<nCl; zz++){
272 Double_t cx = cluster->
GetMean();
274 zcl = 24.5 + 0.920749*zcl;
277 if(type==1 && plane==0){
283 for(Int_t i = 0; i<nIonTr; i++){
287 for(Int_t n = 0; n<nPoints; n++){
289 Double_t x = point->
GetX();
291 Double_t y = point->
GetY();
293 Double_t z = point->
GetZ();
298 for(Int_t clz=0; clz<nCl; clz++){
301 zcl = 24.5 + 0.920749*zcl;
302 Double_t q = cluster->
GetQ();
305 if(type==1 && plane==0 && TMath::Abs(zcl-z)<=0.25){
306 Double_t cx = cluster->
GetMean();
329 for(Int_t i = 0; i<nIonTr; i++){
335 Double_t px = track->
GetPx();
336 Double_t py = track->
GetPy();
337 Double_t pz = track->
GetPz();
343 for(Int_t n = 0; n<nPoints; n++){
345 Double_t x = point->
GetX();
347 Double_t y = point->
GetY();
349 Double_t z = point->
GetZ();
351 for(Int_t j=0;j<
NCHAN;j++){
352 Double_t qx = m1->
GetData(j,z);
354 if (qx>=300 && TMath::Abs(tx)<=0.79){
357 hdxa->Fill(j-x,TMath::Cos(tx));
361 for(Int_t k=0; k<
NADC;k++){
362 Double_t qz1 = m1->
GetData(x,k);
366 hdza->Fill(k-z,TMath::Abs(TMath::Sin(tx)));
385 for(Int_t p=200;p<=401;p++){
386 Double_t b =
hdxq->GetBinContent(p);
388 I+= 0.05*(b*(p-300.5));
390 for(Int_t p=200;p<=401;p++){
391 Double_t b =
hdxq->GetBinContent(p);
392 II+=b*((0.05*(p-300.5))-(I/L))*((0.05*(p-300.5))-(I/L));
394 Double_t si = TMath::Sqrt(II/L);
401 for(Int_t p=100;p<=201;p++){
402 Double_t b =
hdzq->GetBinContent(p);
404 zI+= 0.1*(b*(p-150.5));
406 for(Int_t p=100;p<=201;p++){
407 Double_t b =
hdzq->GetBinContent(p);
408 zII+=b*((0.1*(p-150.5))-(zI/zL))*((0.1*(p-150.5))-(zI/zL));
410 Double_t zsi = TMath::Sqrt(zII/zL);
420 data[4]= (x + (I/L));
423 if (data[3]<1 || data[0]<1)
continue;
439 Int_t nTr = trArray->GetEntries();
441 for(Int_t i = 0; i<nIonTr; i++){
444 Double_t px = mtrack->
GetPx();
445 Double_t py = mtrack->
GetPy();
446 Double_t pz = mtrack->
GetPz();
447 Double_t tx = (px/pz);
448 Double_t ty = (py/pz);
450 if(nIonTr ==0 )
continue;
452 for(Int_t itr = 0; itr<nTr; itr++){
457 hresx->Fill(angle-tx);
458 hresxa->Fill(angle-tx,TMath::Abs(TMath::Cos(tx)));
461 hresy->Fill(angle-ty);
462 hresya->Fill(angle-ty,TMath::Abs(TMath::Cos(ty)));
503 for(Int_t i = 0; i<nIonTr; i++){
506 if (nPoints==0)
continue;
509 Double_t zi = pnti->
GetZ();
511 Double_t zf = pntz->
GetZ();
529 for(Int_t az = zi; az<=zf; az++){
531 for(Int_t j = 0; j<nPoints; j++){
533 Int_t z = point->
GetZ();
534 if(z<az || z>=(az+1))
continue;
535 Double_t nz = point->
GetNe();
558 Double_t fQmin = 10, fQmax = 1e7;
562 Info(
"Constructor",
"Use default fnbinr %d",
fNbins);
568 Info(
"Constructor",
"Use default Qmin %.3g",fQmin);
574 Info(
"Constructor",
"Use default Qmax %.3g",fQmax);
581 hQ[
XPLANE] =
new TH1F(
"Q_x",
"",500,0,2000);
582 hQ[
YPLANE] =
new TH1F(
"Q_y",
"",500,0,2000);
583 hQxy =
new TH1F(
"hQ_xy",
"",500,0,2000);
588 hNeSim =
new TH1F(
"NeSim",
"",35,0,35);
589 hNez =
new TH1F(
"Nez",
"",100,0,100);
592 hMean =
new TH2F(
"MeanQNe",
"",100,0,20000,1000,0,10000000);
593 hRappMean =
new TH1F(
"RapportMeanQNe",
"",50,150,350);
600 hxyz =
new TH3F(
"hxyz",
"",500,-200,200,500,-200,200,500,-200,200);
611 hdx =
new TH1F(
"hdx",
"",600,-15,15);
612 hdxa =
new TH1F(
"hdxa",
"",600,-15,15);
613 hdxq =
new TH1F(
"hdxq",
"",600,-15,15);
615 hdz =
new TH1F(
"hdz",
"",100,-20,20);
616 hdza =
new TH1F(
"hdza",
"",100,-20,20);
617 hdzq =
new TH1F(
"hdzq",
"",100,-20,20);
622 hclx =
new TH1F(
"hclx",
"",300,-15,15);
623 hclxa =
new TH1F(
"hclxa",
"",300,-15,15);
625 hresx =
new TH1F(
"hresx",
"",250,-0.25,0.25);
626 hresy =
new TH1F(
"hresy",
"",250,-0.25,0.25);
627 hresxa =
new TH1F(
"hresxa",
"",125,-0.25,0.25);
628 hresya =
new TH1F(
"hresya",
"",125,-0.25,0.25);
630 TEST =
new TH2F(
"TEST",
"",512,0,512,302,0,302);
631 TEST2 =
new TH2F(
"TEST2",
"",512,0,512,302,0,302);
634 Ntp =
new TNtupleD(
"Ntp",
"",
"zs:zm:sigz:xs:xm:sigx:alpha");
635 Ntp->SetDirectory(0);
704 TCanvas* c = ecTab->GetCanvas();
705 c->GetPad(1)->Delete();
706 c->GetPad(2)->Delete();
718 infobox->NewEntry(
"");
719 infobox->NewEntry(
"Left:");
724 TH2F* ha =
new TH2F(
"ha",
"",512,0,512,288,0,288);
725 TH2F* hb =
new TH2F(
"hb",
"",512,0,512,288,0,288);
727 TH2F* h1 =
new TH2F(
"h1",
"",512,0,512,288,0,288);
728 TH2F* h2 =
new TH2F(
"h2",
"",512,0,512,288,0,288);
730 TH2F* hX =
new TH2F(
"hX",
"",512,0,512,288,0,288);
731 TH2F* hY =
new TH2F(
"hY",
"",512,0,512,288,0,288);
747 for(Int_t i=1;i<
NADC;i++){
748 for(Int_t j=0;j<
NCHAN;j++){
750 ha->SetBinContent(i+1,j+1,q);
756 for(Int_t i=1;i<
NADC;i++){
757 for(Int_t j=0;j<
NCHAN;j++){
759 hb->SetBinContent(i+1,j+1,q);
791 for(Int_t i = 0; i<nIonTr; i++){
794 for(Int_t j = 0; j<nPoints; j++){
796 Double_t x = point->
GetX();
798 Double_t y = point->
GetY();
800 Double_t z = point->
GetZ();
802 h1->SetBinContent(z,x,5000);
803 h2->SetBinContent(z,y,5000);
882 for(Int_t i = 0; i <=512 ; i++ ){
883 for(Int_t j = 0; j <=288 ; j++ ){
886 Double_t na = TMath::Max(zero,ha->GetBinContent(i,j));
887 Double_t nb = TMath::Max(zero,hb->GetBinContent(i,j));
889 Double_t n1 = h1->GetBinContent(i,j);
890 Double_t n2 = h2->GetBinContent(i,j);
892 hX->SetBinContent(i,j,100*(n1+na));
893 hY->SetBinContent(i,j,100*(n2+nb));
905 hX->GetXaxis()->SetTitle(
"Time bin");
906 hX->GetYaxis()->SetTitle(
"Spatial Channel");
907 hY->GetXaxis()->SetTitle(
"Time bin");
908 hY->GetYaxis()->SetTitle(
"Spatial Channel");
929 infobox->NewEntry(
"Right");
981 infobox->NewEntry(
"");
982 infobox->NewEntry(Form(
"Event # %lu",
nEvents));
983 infobox->NewEntry(Form(
"Rapport Q/Ne- : %g",(
qmyn/
emyn)));
984 infobox->NewEntry(Form(
"Angle 1 : %g ; Angle 2 : %g ",(
Ang[0]),(
Ang[1])));
985 infobox->NewEntry(Form(
"NADC : %u ; NCHAN : %u ",NADC,
NCHAN));
997 UInt_t ysize = 10*ysize2;
998 TGTransientFrame*
main =
new TGTransientFrame(gClient->GetRoot(), fMain, xsize, ysize);
999 main->Connect(
"CloseWindow()",
"HarpoRecoMonitorGui", main,
"CloseWindow()");
1000 main->DontCallClose();
1003 main->SetCleanup(kDeepCleanup);
1005 TGVerticalFrame* frame =
new TGVerticalFrame(main,xsize,ysize,kVerticalFrame);
1008 TGLayoutHints* fLayout1 =
new TGLayoutHints(kLHintsLeft ,5,5,5,5);
1009 TGLayoutHints* fLayout2 =
new TGLayoutHints(kLHintsRight ,5,5,5,5);
1010 TGLayoutHints* fLayout3 =
new TGLayoutHints(kLHintsTop | kLHintsExpandX ,5,5,5,5);
1011 TGLayoutHints* fLayout4 =
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,5,5,5,5);
1019 TGLabel* fAnalysisLabel =
new TGLabel(frame,
"Template analysis");
1022 TGHorizontalFrame* nBinsFrame =
new TGHorizontalFrame(frame,xsize,ysize2,kHorizontalFrame);
1023 TGLabel* nBinsLabel =
new TGLabel(nBinsFrame,
"fNbins");
1027 main->AddFrame(frame,fLayout4);
1028 frame->AddFrame(fAnalysisLabel,fLayout3);
1029 frame->AddFrame(nBinsFrame,fLayout3);
1030 nBinsFrame->AddFrame(nBinsLabel,fLayout1);
1037 TGTextButton* setConf =
new TGTextButton(frame,
"Save Config",
id);
1038 setConf->Associate(fMain);
1040 frame->AddFrame(setConf,fLayout3);
1042 main->MapSubwindows();
void Save(char *mode=NULL)
TpcSimIonisationTrack * GetIonisationTrack(Int_t iTr)
HarpoRecoEvent * GetRecoEvent()
Double_t GetData(Int_t i, Int_t j)
Set/Get Data Cell.
int main(int argc, char **argv)
Bool_t isExist(ULong_t det)
Detecror date exist //! Number of Real Detectors.
Track object, containing position, angle, charge and quality information.
Object containing the reconstruction information for one event (with array of HarpoRecoClusters Harpo...
TpcSimIonisationPoint * GetPoint(Int_t i)
A class store HARPO row DCC event data and header. End provide access metods to the row data...
TGNumberEntry * fChooseNbins
Cluster object, containing position, charge and quality information.
TFile * OpenHistFile(const char *ananame)
unpacked dcc data The class contains the data map for DCC or Feminos The data is stored as a 2D TMatr...
void DisplayAnalysis(TRootEmbeddedCanvas *ecTab, TGListBox *infobox)
Redefine empty default.
void ConfigFrame(TGMainFrame *fMain, Int_t id)
HarpoDetEvent * GetDetEvent(Long_t plane=XDCC)
Data from Keller temperuture and pressure sensors.
TVirtualPad * MakeNiceHisto(TH1 *hist, TVirtualPad *c1, const char *opt, Bool_t copy)
TpcSimMCTrack * GetTrack(Int_t i)
TpcSimMCEvent * GetMCEvent()
Bool_t Lookup(const char *path, Bool_t &val)
Lookup function for scalar values.
const ULong_t gkNDetectors
TClonesArray * GetTracksArray()
HarpoDccMap * GetDccMap(Long_t plane=XDCC)
TClonesArray * GetClustersArray()
R__EXTERN HarpoDetSet * gHDetSet