Newer
Older
Simon Zhamkochyan
committed
#ifndef ROOT_THcShower
#define ROOT_THcShower
///////////////////////////////////////////////////////////////////////////////
// //
Simon Zhamkochyan
committed
// //
///////////////////////////////////////////////////////////////////////////////
#include "TClonesArray.h"
#include "THaNonTrackingDetector.h"
#include "THcHitList.h"
Simon Zhamkochyan
committed
class THaScCalib;
class THcShower : public THaNonTrackingDetector, public THcHitList {
public:
THcShower( const char* name, const char* description = "",
THaApparatus* a = NULL );
virtual ~THcShower();
virtual void Clear( Option_t* opt="" );
Simon Zhamkochyan
committed
virtual Int_t Decode( const THaEvData& );
virtual EStatus Init( const TDatime& run_time );
virtual Int_t CoarseProcess( TClonesArray& tracks );
virtual Int_t FineProcess( TClonesArray& tracks );
virtual Int_t ApplyCorrections( void );
// Int_t GetNHits() const { return fNhit; }
Int_t GetNTracks() const { return fTrackProj->GetLast()+1; }
const TClonesArray* GetTrackHits() const { return fTrackProj; }
Int_t GetNBlocks(Int_t NLayer) const { return fNBlocks[NLayer];}
// friend class THaScCalib; not needed?
Simon Zhamkochyan
committed
Int_t GetPedLimit(Int_t NBlock, Int_t NLayer, Int_t Side) {
Vardan Tadevosyan
committed
if (Side!=0&&Side!=1) {
cout << "*** Wrong Side in GetPedLimit:" << Side << " ***" << endl;
Vardan Tadevosyan
committed
return -1;
}
Int_t nelem = 0;
for (Int_t i=0; i<NLayer; i++) nelem += fNBlocks[i];
nelem += NBlock;
Vardan Tadevosyan
committed
return ( Side == 0 ? fShPosPedLimit[nelem] : fShNegPedLimit[nelem]);
}
Double_t GetGain(Int_t NBlock, Int_t NLayer, Int_t Side) {
if (Side!=0&&Side!=1) {
cout << "*** Wrong Side in GetGain:" << Side << " ***" << endl;
Int_t nelem = 0;
for (Int_t i=0; i<NLayer; i++) nelem += fNBlocks[i];
nelem += NBlock;
return ( Side == 0 ? fPosGain[nelem] : fNegGain[nelem]);
}
Int_t GetMinPeds() {
return fShMinPeds;
}
Simon Zhamkochyan
committed
THcShower(); // for ROOT I/O
Simon Zhamkochyan
committed
protected:
Int_t fAnalyzePedestals;
Vardan Tadevosyan
committed
// ADC signal limits for pedestal calculations.
Int_t* fShPosPedLimit;
Int_t* fShNegPedLimit;
Int_t fShMinPeds; //Min.number of events to analize/update pedestals.
// Calibration constants
Double_t* fPosGain;
Double_t* fNegGain;
Simon Zhamkochyan
committed
// Per-event data
// Potential Hall C parameters. Mostly here for demonstration
// Int_t fNRows; fNBlocks is used instead
Double_t* fNLayerZPos; // Z position of front of shower counter layers
Simon Zhamkochyan
committed
Double_t* BlockThick; // Thickness of shower counter blocks, blocks
Int_t* fNBlocks; // Number of shower counter blocks per layer
Int_t fNtotBlocks; // Total number of shower counter blocks
Simon Zhamkochyan
committed
Double_t** YPos; //X,Y positions of shower counter blocks
Double_t* XPos;
Int_t fNegCols; //number of columns with PMTTs on the negative side only.
Double_t fSlop; //Track to cluster vertical slop distance.
Int_t fvTest; //fiducial volume test flag
Simon Zhamkochyan
committed
THcShowerPlane** fPlanes; // List of plane objects
Simon Zhamkochyan
committed
TClonesArray* fTrackProj; // projection of track onto scintillator plane
// and estimated match to TOF paddle
Simon Zhamkochyan
committed
// Useful derived quantities
// double tan_angle, sin_angle, cos_angle;
// static const char NDEST = 2;
// struct DataDest {
// Int_t* nthit;
// Int_t* nahit;
// Double_t* tdc;
// Double_t* tdc_c;
// Double_t* adc;
// Double_t* adc_p;
// Double_t* adc_c;
// Double_t* offset;
// Double_t* ped;
// Double_t* gain;
// } fDataDest[NDEST]; // Lookup table for decoder
void ClearEvent();
void DeleteArrays();
virtual Int_t ReadDatabase( const TDatime& date );
virtual Int_t DefineVariables( EMode mode = kDefine );
// enum ESide { kLeft = 0, kRight = 1 };
Simon Zhamkochyan
committed
// virtual Double_t TimeWalkCorrection(const Int_t& paddle,
// const ESide side);
Simon Zhamkochyan
committed
void Setup(const char* name, const char* description);
Simon Zhamkochyan
committed
ClassDef(THcShower,0) // Generic hodoscope class
};
////////////////////////////////////////////////////////////////////////////////
#endif