#include ClassImp (TClcModule) //_____________________________________________________________________________ TClcModule::TClcModule() { fT0 = 0.; fT0W = 0.; fLayer = new TClcLayer[kNLayers]; } //_____________________________________________________________________________ TClcModule::~TClcModule() { delete [] fLayer; } //_____________________________________________________________________________ void TClcModule::Clear(Option_t* opt) { fNTdcHits = 0; for (int i=0; iClear(); } } //_____________________________________________________________________________ int TClcModule::CalculateMeanTime(Float_t tmin, Float_t tmax, Float_t adcThr) { // don't assume that mean times for the layers have previously // been calculated, but rely on that the data has been read in int nch; float time, timew; fNTdcHits = 0; fNHitChannels = 0; fNUsedChannels = 0; fNUsedChannelsW = 0; fMeanTime = -999.; fMeanTimeW = -999.; time = 0; timew = 0; for (int i=0; iCalculateMeanTime(tmin,tmax,adcThr); fNTdcHits += lay->NTdcHits(); nch = lay->NHitChannels(); fNHitChannels += nch; fNUsedChannels += lay->NUsedChannels (); fNUsedChannelsW += lay->NUsedChannelsW(); time += lay->NUsedChannels ()*lay->MeanTime(); timew += lay->NUsedChannelsW()*lay->MeanTimeW(); } // calculate time only if it // makes sense if (fNUsedChannels > 0) { fMeanTime = time /fNUsedChannels; if (fNUsedChannelsW > 0) { fMeanTimeW = timew/fNUsedChannelsW; } } return 0; } //_____________________________________________________________________________ Int_t TClcModule::NChannelsAbove(Int_t adcThreshold) { // calculate number of channels in this layer with the ADC counts above // the given `adcThreshold' int nch = 0; for (int i=0; iNChannelsAbove(adcThreshold); } return nch; } //_____________________________________________________________________________ Int_t TClcModule::NHits(Float_t sppThreshold) { // calculate number of channels in this layer with the ADC counts above // the given `spp' threshold int nch = 0; for (int i=0; iNHits( sppThreshold); } return nch; } //_____________________________________________________________________________ void TClcModule::Print(const char* opt) { }