--- DarthVader/ToFLevel2/inc/ToFLevel2.h 2007/11/23 16:42:51 1.19 +++ DarthVader/ToFLevel2/inc/ToFLevel2.h 2014/09/16 08:05:40 1.33 @@ -1,6 +1,6 @@ /** * \file ToFLevel2.h - * \author Gianfranca DeRosa / Wolfgang Menn + * \author Gianfranca DeRosa / Wolfgang Menn / Rita Carbone with E. M. supervision */ #ifndef ToFLevel2_h @@ -12,9 +12,31 @@ #include #include // EMILIANO +#include // from ToFLevel2.cpp +#include // Emiliano +#include // Emiliano +#include // Emiliano + #include +#include // Emiliano +#include // Emiliano +#include // Emiliano +#include // Emiliano +#include // Emiliano +#include + +// +// Declaration of the core fortran routines +// +#define tofl2com tofl2com_ +extern "C" int tofl2com(); +#define toftrk toftrk_ +extern "C" int toftrk(); +#define rdtofcal rdtofcal_ +//extern "C" int rdtofcal(char [], int *); +extern "C" int rdtofcal(const char *, int *); // // class which contains track related variables @@ -27,6 +49,35 @@ #define ZTOF32 -24.34 +class ToFGeom : public TObject { + +private: + TArrayI ePlane, eXY; + +public: + ToFGeom() { + int plane[24] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, + 2, 2, + 3, 3, + 4, 4, 4, + 5, 5, 5 + }; + int plXY[6]= { 2, 1, 1, 2, 2, 1 }; // X==1, Y==2 */ + ePlane.Set(24,plane); + eXY.Set(6,plXY); + } + + int GetPad( int idpmt) { return (int)((idpmt+0.5)/2.); } + int GetPlane( int idpmt) { return ePlane[ GetPad(idpmt) ]; } + int GetXY( int idpmt) { return eXY[ GetPlane(idpmt) ]; } + + ClassDef(ToFGeom,1); + +}; + + /** * \brief Class which contains the PMT data * @@ -40,9 +91,11 @@ public: Int_t pmt_id; ///At(ipmt); } // 0-47 dEdx for each PMT for tracked events + // + ToFdEdx* GetToFdEdx(){return this;}; + ClassDef(ToFdEdx,3); }; @@ -84,15 +205,21 @@ TArrayI tdcflag; /// "x"-sigma. A chi2 value is + * calculated, furthermore a "quality" value by adding the weights which + * are finally used. If all measurements are taken, "quality" will be = 505. + * A chi2 cut around 3-4 and a quality-cut > 400 is needed for clean beta + * The Level2 beta[12] which is derived in the fortran routines uses: 10.,200.,20. + * This is not a very high quality measurement. One can re-calculate a new beta[13] + * using the L2-method "CalcBeta" */ Float_t beta[13]; // @@ -131,10 +258,17 @@ TClonesArray *ToFTrk; /// bit 0 = discharging flag on at least one PMT (adc OR tdc), bit 1 = there is at least one PMT off (no tdc nor adc) which is included in the patterntrig, bit 2 = PMTs hit are not enough to match trigger configuration, bit 3 = pattern trig does not match trigger configuration Int_t default_calib; ///< one if the default calibration has been used to process the data, zero otherwise // Float_t GetdEdx(Int_t notrack, Int_t plane, Int_t adcfl); // gf Apr 07 + Float_t GetdEdx(ToFTrkVar *trk, Int_t plane, Int_t adcfl); // gf Apr 07 + + Float_t CalcBeta(Int_t notrack, Float_t resmax, Float_t qualitycut, Float_t chi2cut); // wm feb 08 + + // +// Float_t CalcBeta(Int_t notrack, Float_t resmax, Float_t chi2cut, Float_t qualitycut); // wm feb 08 // // methods to make life simplier during the analysis, returns a pointer to the ToFTrkVar class containing track related variables // @@ -155,8 +289,10 @@ // gf Apr 07 void GetdEdxPaddle(Int_t notrack, Int_t paddleid, Int_t adcfl, Float_t &PadEdx, Int_t &SatWarning); // gf Apr 07 + void GetdEdxPaddle(ToFTrkVar *trk, Int_t paddleid, Int_t adcfl, Float_t &PadEdx, Int_t &SatWarning); // gf Apr 07 TString GetPMTName(Int_t ind, Int_t &iplane, Int_t &ipaddle,Int_t &ipmt); - Int_t GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane); // gf Apr 07 + Int_t GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane); // gf Apr 07 //EMXX + Int_t GetPaddleIdOfTrack(Float_t xtr, Float_t ytr, Int_t plane, Float_t margin); // wm jun 2008 void GetPMTPaddle(Int_t pmt_id, Int_t &plane, Int_t &paddle); // gf Apr 07 void GetPaddlePMT(Int_t paddle, Int_t &pmtleft, Int_t &pmtright); // gf Apr 07 void GetPaddleGeometry(Int_t plane, Int_t paddle, Float_t &xleft, Float_t &xright, Float_t &yleft, Float_t &yright); // gf Apr 07 @@ -164,7 +300,18 @@ void GetPaddlePlane(Int_t padid, Int_t &plane, Int_t &paddle); Int_t GetNPaddle(Int_t plane); // - + // + // + Int_t Process(TrkLevel2 *trk, TrigLevel2 *trg, GL_RUN *run, OrbitalInfo *orb, Bool_t force); // Emiliano + + // + // + bool bit(int decimal, char pos); + bool checkPMT(TString givenpmt); + bool checkPMTpatternPMThit(TrigLevel2 *trg, int &pmtpattern, int &pmtnosignal); + bool checkPMTpmttrig(TrigLevel2 *trg); + void printPMT(); + // // constructor // @@ -206,11 +353,18 @@ Int_t GetToFPlaneID(Int_t ip); Int_t GetToFPlaneIndex(Int_t plane_id); - Bool_t HitPaddle(Int_t ,Int_t); + Bool_t HitPaddle(Int_t ,Int_t); // EMXX Int_t GetNHitPaddles(Int_t plane); + Int_t GetTrueNHitPaddles(Int_t plane); void Clear(Option_t *t=""); + + // + TClonesArray *GetTrackArray(){return ToFTrk;} ///< returns a pointer to the track related variables array + TClonesArray** GetPointerToTrackArray(){return &ToFTrk;}///< returns pointer to pointer to the track array + + // - ClassDef(ToFLevel2,3); + ClassDef(ToFLevel2,6); }; #endif