void KVHarpeeSi::SetCalibrators() { // Pulse Height Defect calibrator as well as the calibrators of // KVVAMOSDetector. KVVAMOSDetector::SetCalibrators(); // Set PHD calibrator only if the detector has an acq. parameter // with type 'E' TObject* par = GetACQParamList()->FindObjectByType("E"); if (!par) return; TString type("channel->MeV "); type.Append(par->GetName()); fCanalE = (KVFunctionCal*)GetCalibrator(type.Data()); if (!fCanalE) Error("SetCalibrators", "channel->MeV calibrator not found"); KVRecombination* c = new KVRecombination(this); type = c->GetType(); type.Append(" "); type.Append(par->GetName()); c->SetType(type.Data()); if (!AddCalibrator(c)) delete c; fPHD = (KVRecombination*)GetCalibrator(type.Data()); }
KVList *KVSpectroDetector::GetFiredACQParamList(Option_t *opt){ // Returns a list with all the fired acquisiton parameters of // this detector. The option is set to the method KVACQParam::Fired; // // *** WARNING *** : DELETE the list returned by this method after using it !!! TIter next( GetACQParamList() ); KVACQParam *par = NULL; KVList *list = new KVList( kFALSE ); while( (par = (KVACQParam *)next()) ){ if( par->Fired( opt ) ) list->Add( par ); } return list; }
UInt_t KVHarpeeIC::GetFiredSegNumber(Option_t* opt) { // return the number of the fired segment of this Harpee ionisation chamber // ( number between 1 to 7 ). Returns 0 if no segment or several segments // are fired. A segment is considered as fired if at least one of its 3 // acquisition parameters (A, B and C) is fired (KVACQParam::Fired( opt )). // Set the option opt = "P" to accept only the acquisition parameters with // their value above the pedestal. TIter next(GetACQParamList()); KVACQParam* par = NULL; UInt_t num = 0; while ((par = (KVACQParam*)next())) { if (par->Fired(opt)) { if (num && (num != par->GetNumber())) return 0; num = par->GetNumber(); } } return num; }
Int_t KVSpectroDetector::GetMult(Option_t *opt){ // Returns the multiplicity of fired (value above the pedestal) // acquisition parameters if opt = "" (default). // If opt = "root" returns the multiplicity of only fired acq. // parameters with GetName() containing "root". For example if // you want the multiplicity of fired segments B of a child class // KVHarpeeIC call GetMult("ECHI_B"). Int_t mult = 0; TString str( opt ); Bool_t withroot = !str.IsNull(); TIter next( GetACQParamList() ); KVACQParam *par = NULL; while( (par = (KVACQParam *)next()) ){ if( withroot ){ str = par->GetName(); if( !str.Contains( opt ) ) continue; } if( par->Fired("P") ) mult++; } return mult; }