コード例 #1
0
//___________________________________________________________________________________________
void KVIntegerList::SetPartition(const Char_t* par)
{
//protected method, utilisée par le Streamer qui utilise le champ fName de la classe TNamed
//voir également KVIntegerList::DeducePartitionFromTNamed
   KVString st(par);
   st.Begin(" ");
   TObjArray* toks = 0;
   while (!st.End()) {
      KVString tamp = st.Next();
      Int_t val;
      Int_t freq;
      if (tamp.Contains("(")) {
         if (!tamp.Contains(")")) {
            Warning("SetPartition", "%s ->pb de coherence dans les parentheses", tamp.Data());
            return;
         } else {
            toks = tamp.Tokenize("(");
            val = ((TObjString*)toks->At(0))->GetString().Atoi();
            freq = ((TObjString*)toks->At(1))->GetString().Atoi();
            delete toks;
         }
      } else {
         val = tamp.Atoi();
         freq = 1;
      }
      Add(val, freq);
   }

}
コード例 #2
0
void KVBatchSystemManager::Init()
{
   //Set up list of available batch systems

   gBatchSystem = 0;

   KVString list = gEnv->GetValue("BatchSystem", "");

   fBatchSystems.Clear();

   TObjArray* systems = list.Tokenize(" ");
   TIter next(systems);
   TObjString* batch_sys;
   while ((batch_sys = (TObjString*)next())) {

      KVBatchSystem* bs = KVBatchSystem::GetBatchSystem(batch_sys->GetString().Data());
      fBatchSystems.Add(bs);
   }

   delete systems;

   //set default
   fDefault = (KVBatchSystem*)fBatchSystems.FindObjectByName(gEnv->GetValue("Default.BatchSystem", ""));
}
コード例 #3
0
//________________________________________________________________
void KVVAMOSDetector::SetFiredBitmask(KVString& lpar_dummy)
{
   // Set bitmask used to determine which acquisition parameters are
   // taken into account by KVVAMOSDetector::Fired based on the environment variables
   //          [dataset].KVACQParam.[par name].Working:    NO
   //          [dataset].KVDetector.Fired.ACQParameterList.[type]: Q,T,T_HF,E,X,Y
   // The first allows to define certain acquisition parameters as not functioning;
   // they will not be taken into account.
   // The second allows to "fine-tune" what is meant by "all" or "any" acquisition parameters
   // (i.e. when using Fired("all"), Fired("any"), Fired("Pall", etc.).
   // For each detector type, give a comma-separated list of the acquisition
   // parameter types to be taken into account in the KVDetector::Fired method.
   // Only those parameters which appear in the list will be considered:
   // then "all" means => for each type in the list at least one acquisition
   //                     parameter has to be fired
   // and  "any" means => at least for one type of the list an acquisition parameter
   //                     has to be fired
   // These lists are read during construction of VAMOS (KVVAMOS::Build),
   // the method KVVAMOS::SetACQParams uses them to define a mask for each detector
   // of the spectrometer.
   // X, Y and Z types that we can set in a list are not associated to acquisition
   // parameters. In the bitmask, the 3 first bits are kept for these coordinates.
   // If one of these 3 bits is 1 then the methode GetRawPosition(Double_t *)
   // is called and the returned values is compared to these 3 bits.
   // If no variable [dataset].KVDetector.Fired.ACQParameterList.[type] exists,
   // we set a bitmask authorizing all acquisition parameters of the detector, e.g.
   // if the detector has 3 types of acquisition parameters which are fired byt
   // no position type then the bitmask will be "111000"

   UNUSED(lpar_dummy); // lpar is determined below

   fFiredMask.Set("");

   KVString inst;
   //inst.Form("KVVAMOSDetector.Fired.ACQParameterList.%s", GetType());
   inst.Form(GetFiredACQParameterListFormatString(), GetType());
   KVString lpar = gDataSet->GetDataSetEnv(inst);
   TObjArray* toks = lpar.Tokenize(",");
   if (!toks->GetEntries()) {
      fFiredMask.Set("11111111");
      delete toks;
      return;
   }

   // 3 first bits for XYZ positions
   UChar_t idx;
   const Char_t* pos[3] = {"X", "Y", "Z"};
   for (Int_t i = 0; i < 3; i++) {
      idx = GetPositionTypeIdx(pos[i]) ;
      if ((idx < 9) && (toks->FindObject(pos[i]))) fFiredMask.SetBit(i);
   }

   UChar_t Nbits = 3;

   // other bits for Acquisition parameters
   UChar_t idx_max = 0;
   Bool_t  found   = kFALSE;
   TIter next(toks);
   TObject* obj = NULL;
   while ((obj = next())) {
      idx = GetACQParamTypeIdx(obj->GetName());
      if (idx < 9) {
         found = kTRUE;
         fFiredMask.SetBit(idx + Nbits);
         if (idx > idx_max) idx_max = idx;
      }
   }
   delete toks;

   if (found) Nbits += idx_max + 1;

   fFiredMask.SetNBits(Nbits);
}