//////////////////////////////////// // ALADiN ToF-Wall event unpacker // for the AsyEOS experiment // March 2012 // Arnaud Le Fevre - ver 1.0 // a.lefevre@gsi.de //////////////////////////////////// #ifndef TATOFEvent_H #define TATOFEvent_H #include #include #include #include #include #include #include #include #include #include #include "TFile.h" #include "TGraph.h" #include "TGraphErrors.h" #include "TH1F.h" #include "TH2D.h" #include "TMath.h" #include "TSystem.h" #include "TString.h" #include "TROOT.h" #include "TApplication.h" #include "TClass.h" #include "TSysEvtHandler.h" #include "TMonitor.h" #include "TString.h" #include "TList.h" #include "TObject.h" #include "TATOFparaDsc.h" #include "TATOFpara.h" #include "TATOFparMap.h" #include "TATOFroot.h" //#include "TATOFactDatFbus.h" //#include "TATOFaction.h" #include "TATOFdataDsc.h" #include "TATOFdatRaw.h" #include "TATOFparFbusCal.h" //#include "TATOFmbsEvent.h" // peut-etre a enlever (inutile) #include "TATOFdatFbus.h" #include "TATOFactDatFbus.h" //#include "TMbsInfo.h" // access to run number - ALF, 12/2013 //#include "FairRootManager.h" // //#include "TATOFmbsEvent.h" //#include "TATOFmbsEventFilterType.h" //#include "FairRunAna.h" // access to current run number //#include "FairRuntimeDb.h" // access to current run start time // For corrections of ADC top/bottom values of the beam hole slats static const Char_t InputFileADCcorrHoleSlats[]="Adcb_Adct_HoleModule.root"; static TH1F *hMedianSlopeADCtb_hole; static const Int_t SlatMinHole=50; // in reality, the hole concern slats 51-53 static const Int_t SlatMaxHole=54; // but neighbouring slats show similar effects // probably due to brownishing (too much irradiated in the centre) static TGraph *gADCcorrHoleSlat[2][200]; // For harmonisation factors of ADC's top/bottom static const Char_t InputFileADCharmonisation[]="ADCgainHarmonisation.root"; static const Int_t SlatMin=25; static const Int_t SlatMax=72; static const Char_t *ctb[2]={"top","bot"}; static TH1F *hp2ADCratio; static const Char_t InputFileMultihitCut[]="ExtractMultihitCut2.root"; static const Char_t InputFileMultihitCutParam[]="MultihitCutParameters2.root"; // here are stored the cut parameters static const Float_t ToleranceDeltaxE=0.4; // for clean Zid. (TOF-ADC) maps static const Float_t ToleranceDeltaxE_loose=1.; // less hard static TGraph *g2DxtxE[200]; static TH1F *hxtmin,*hxtmax; // For final ADC calibration (energy-like, using stretching parameters of the Z identification) static TGraph *gZidGridRefInv[100]; // inverted version of gZidGrid Z grid lines (becomes ADC vs ToF) for the reference slat 64 static Float_t RefSlatADCthreshold; static Int_t ZnextAvailable[100]; // next Z id. grid available (index = Z) // For Z identification static const Char_t InputFileZidGrids[]="Zgrid_slat64_ElossCorrected_s394.root"; static const Char_t InputFileZidQuality[]="ZidQuality.dat"; static TGraph *gZidGrid[100][200]; static Bool_t ZgridAvailable[100][200]; static Bool_t BadZresolution[200]; // For TDC calibration static const Char_t InputFileWalkTDC[]="WalkTDC_1670-1690.root"; static TGraph *gWalkTDC[200][2]; static const Float_t DistanceTargetFrontWall=369.9; // (cm) - as announced by P. Russotto and S. Santoro, 14th Sept. 2012 static const Float_t DistanceTargetFrontWallOld=450.; // (cm) - has to be confirmed/precised - Paolo did not communicate the value - 26-04-2012 static const Float_t DistanceTargetRearWall=DistanceTargetFrontWall+8.; static const Float_t EAproj=400.; // projectile kinetic energy per nucleon (MeV) static const Float_t BetaProj=sqrt((1-pow(1+EAproj/931.5,-2))); static const Float_t ToFprojFrontWall=DistanceTargetFrontWall/(BetaProj*30.); // (ns) - should be around 17 ns static const Float_t ToFprojRearWall=DistanceTargetRearWall/(BetaProj*30.); // (ns) static const Float_t MeanRawTDChighZslat64=-104.7; // (ns) - mean value of -(TDCtop+TDCbot)/40.-tstart of Z>10 for reference slat 64 static const Float_t TimeOffsetRef[2]={ToFprojFrontWall-MeanRawTDChighZslat64, ToFprojRearWall-MeanRawTDChighZslat64}; static const Float_t TimeOffsetRef_DiffOldNew = (DistanceTargetFrontWallOld-DistanceTargetFrontWall)/(BetaProj*30.); static const Float_t RefractionIndex=1.59; // refraction index of plastic scintillators // For geometry static const Float_t MiddleSlatFront=51.8; // mean front slat value of heavy element yields (Au run 1670 s394) static const Float_t MiddleSlatRear=152.4; // mean rear slat value of heavy element yields (Au run 1670 s394) // For global variable calculations static const Int_t MinNATOF=3; // minimum number of accepted particles requested to provided reaction plane Phi static const Float_t betaSystCM=0.419222; // beta of the centre-of-mass of symmetrical systems @ 400 A.MeV incident energy static const Char_t InputPhiWeight[]="PhiWeightMaps.root"; static TH2D *PhiWeightVsZbound; // correction weight to be applied on phi vs Zbound2 (for one of the 3 systems Au, Ru, Zr, according to the current run number) static const Char_t *PhiWeightSystem[3]={"au400","ru400","zr400"}; static const Int_t RunMinSystem[3]={1334,1850,2020}; static const Int_t RunMaxSystem[3]={1833,1974,2227}; static Int_t iCurrentSystemIndex; // 0, 1, 2. If = -1, means that no phi weighting can be applied (because run number incorrect) //static TATOFparaDsc *p_tmap; class TATOFEvent { //protected: //int fRawmulti; //raw multiplicity //protected: //TMbsInfo * fMbsInfo; // ALF, 12/2013 //TClonesArray * fMbsInfoClone; // ALF, 12/2013 public: TATOFEvent(); //constructor virtual ~TATOFEvent(); //destructor Bool_t LoadMapping(const char *); Bool_t ProcessCurrentEventMBS(Int_t*, Int_t); Bool_t LoadCalibrationParameters(const char *); // 11/2012 Bool_t Calibration(Int_t,Int_t,Int_t,Int_t,Int_t,Int_t,Float_t, Float_t &,Float_t &,Float_t &,Float_t &,Int_t &,Float_t &,Int_t &); private: Bool_t MultihitCal(Int_t,Int_t,Int_t,Float_t,Float_t,Float_t&); // For global ADC corrections Bool_t ADCcalibration0(Int_t,Int_t,Int_t,Int_t&,Int_t&); Bool_t ADCcalibrationFinal(Int_t,Int_t,Float_t,Float_t&); // For TDC calibration Bool_t TDCcalibration(Int_t,Int_t,Int_t,Int_t,Float_t,Int_t,Float_t&,Float_t&,Float_t&,Float_t&); // For charge identification Bool_t Zid(Int_t,Float_t,Float_t,Float_t&,Int_t&,Int_t&); // For corrections of ADC top/bottom values of the beam hole slats Bool_t ADCcorrHoleSlat(Int_t,Int_t,Int_t,Int_t&,Int_t&); // For harmonisation factors of ADC's top/bottom Bool_t ADCtbHarmonise(Int_t,Int_t,Int_t,Int_t&,Int_t&); }; extern TATOFEvent *gatofevent; // a global instance to TATOFEvent class //static TATOFparaDsc *p_tmap; extern TATOFparaDsc *p_tmap; extern TATOFdataDsc *p_datraw; /* extern TATOFdataDsc *n_trtrk = 0; extern TATOFactNtuRawTrack *an_trtrk =0; extern TATOFdataDsc *n_traw = 0; extern TATOFactNtuRaw *an_traw = 0;*/ #endif