void KVGANILDataReader::FillFiredParameterList() { // clears and then fills list fFired with all fired acquisition parameters in event fFired->Clear(); TIter next(fParameters); KVACQParam *par; while( (par = (KVACQParam*)next()) ) if(par->Fired()) fFired->Add(par); }
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; }
Bool_t KVVAMOSDetector::Fired(Option_t* opt, Option_t* optP) { //Returns kTRUE if detector was hit (fired) in an event // //The actual meaning of hit/fired depends on the context and the option string opt. // //opt="any" (default) and optP="": //Returns true if at least one working acquisition parameter //associated with the detector was fired in an event, for ANY of the types //in the list*. // //opt="all" and optP="" : //Returns true if at least one working acquisition parameter //associated with the detector was fired in an event, for ALL of the types //in the list*. // //opt="any" and optP="P" : //Returns true if at least one working acquisition parameter //associated with the detector was fired in an event and have a value //greater than their pedestal value, for ANY of the types in the list*. // //opt="all" and optP="P": //Returns true if at least one working acquisition parameter //associated with the detector was fired in an event and have a value //greater than their pedestal value, for ALL of the types in the list*. // // *the actual parameters taken into account can be fine tuned using environment variables such as // KVVAMOSDetector.Fired.ACQParameterList.[type]: Q,E,T,T_HF,X,Y // See KVAMOSDetector::SetFiredBitmask() for more details. if (!IsDetecting()) return kFALSE; //detector not working, no answer at all Bool_t opt_all = !strcmp(opt, "all"); Binary8_t event; // bitmask for event // Look at the three first bits for XYZ positions UChar_t xyz_mask = fFiredMask.Subvalue(2, 3); // Info("Fired","Option %s, FiredBitmask %s, xyz_mask (%d)",opt,fFiredMask.String(), xyz_mask); if (xyz_mask) { Double_t xyz[3]; UChar_t xyz_res = GetRawPosition(xyz); // cout<<Form(" xyz_res (%d)",xyz_res)<<endl; if (opt_all && (xyz_mask != xyz_res)) return kFALSE; event.Set(xyz_res); } // Look at the other bits for ACQ Parameters UChar_t Nbits = fFiredMask.GetNBits(); Binary8_t keep_up(fFiredMask.Subvalue(Nbits - 1, Nbits - 3)); // Info("Fired","keep_up %s",keep_up.String()); UChar_t id; TIter next(GetACQParamList()); TIter next_t(GetTACQParamList()); KVACQParam* par; while (keep_up.Value() && ((par = (KVACQParam*)next()) || (par = (KVACQParam*)next_t()))) { if (par->IsWorking() && par->Fired(optP)) { id = GetACQParamTypeIdxFromID(par->GetUniqueID()); event.SetBit(id + 3); keep_up.ResetBit(id); } // Info("Fired","%s is %s fired, keep_up %s",par->GetName(), par->Fired( optP ) ? "" : "NOT" ,keep_up.String()); } Binary8_t ok = fFiredMask & event; // Info("Fired","ok %s", ok.String()); // "all" considered parameters fired if ok == mask // "any" considered parameters fired if ok != 0 if (opt_all) return (ok == fFiredMask); return (ok != "0"); }