#include ClassImp (TClcLayer) //_____________________________________________________________________________ TClcLayer::TClcLayer() { fNTdcHits = 0; fMeanTime = -999.; fMeanTimeW = -999.; fT0 = 0.; fT0W = 0.; fChannel = new TClcChannel* [kNChannels]; } //_____________________________________________________________________________ TClcLayer::~TClcLayer() { delete [] fChannel; } //_____________________________________________________________________________ void TClcLayer::Clear(const char* opt) { fNTdcHits = 0; fMeanTime = -999.; fMeanTimeW = -999.; for (int i=0; iClear(); } } //_____________________________________________________________________________ Int_t TClcLayer::CalculateMeanTime(Float_t tmin, Float_t tmax, Float_t adc_threshold) { fMeanTime = 0; fMeanTimeW = 0; fTMin = tmin; fTMax = tmax; fAdcThreshold = adc_threshold; fNUsedChannels = 0; fNUsedChannelsW = 0; // use only good channels to calculate // times int nhits; for (int i=0; iBad()) { nhits = Channel(i)->NTdcHits(); if (nhits) { fNHitChannels += 1; if (ch->AdcCounts() > adc_threshold) { // use only the 1st hit per channel // to calculate timing, require timing // to be reasonable // account for global delays float time = ch->Time(0)+T0(); if ( (time > tmin) && (time < tmax) ) { fMeanTime += time; fNUsedChannels += 1; if (ch->Slope() != 0) { fMeanTimeW += ch->BestTime(0)+T0W(); fNUsedChannelsW += 1; } } } } } } if (fNUsedChannels) { fMeanTime = fMeanTime/fNUsedChannels; if (fNUsedChannelsW) { fMeanTimeW = fMeanTimeW/fNUsedChannelsW; } else { fMeanTimeW = -9999.; } } else { fMeanTime = -9999.; fMeanTimeW = -9999.; } return 0; } //_____________________________________________________________________________ Int_t TClcLayer::NChannelsAbove(Int_t adcThreshold) { // calculate number of channles in this layer with the ADC counts above // the given `adcThreshold' int nch = 0; for (int i=0; iBad()) { if (ch->AdcCounts() > adcThreshold) { nch++; } } } return nch; } //_____________________________________________________________________________ Int_t TClcLayer::NHits(Float_t sppThreshold) { // calculate number of channles in this layer with the ADC counts above // the given `adcThreshold' int nch = 0; for (int i=0; iBad()) { if ( ch->Energy() > sppThreshold) { nch++; } } } return nch; } //_____________________________________________________________________________ void TClcLayer::Print(const char* opt) { }