当前位置: 首页>>代码示例>>C++>>正文


C++ KVDetector类代码示例

本文整理汇总了C++中KVDetector的典型用法代码示例。如果您正苦于以下问题:C++ KVDetector类的具体用法?C++ KVDetector怎么用?C++ KVDetector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了KVDetector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetGeometryParameters

void KVFAZIA::Build(Int_t)
{
   // Build the combined INDRA & FAZIA arrays
   GetGeometryParameters();
   GenerateCorrespondanceFile();

   if (!gGeoManager) {
      new TGeoManager("FAZIA", Form("FAZIA geometry for dataset %s", gDataSet->GetName()));

      TGeoMaterial* matVacuum = gGeoManager->GetMaterial("Vacuum");
      if (!matVacuum) {
         matVacuum = new TGeoMaterial("Vacuum", 0, 0, 0);
         matVacuum->SetTitle("Vacuum");
      }
      TGeoMedium* Vacuum = gGeoManager->GetMedium("Vacuum");
      if (!Vacuum) Vacuum = new TGeoMedium("Vacuum", 1, matVacuum);
      TGeoVolume* top = gGeoManager->MakeBox("WORLD", Vacuum,  500, 500, 500);
      gGeoManager->SetTopVolume(top);
   }

   BuildFAZIA();
   if (fBuildTarget)
      BuildTarget();

   KVGeoImport imp(gGeoManager, KVMaterial::GetRangeTable(), this, kTRUE);
   imp.SetDetectorPlugin(ClassName());
   imp.SetNameCorrespondanceList(fCorrespondanceFile.Data());
   // any additional structure name formatting definitions
   DefineStructureFormats(imp);

   // the following parameters are optimized for a 12-block compact
   // geometry placed at 80cm with rings 1-5 of INDRA removed.
   // make sure that the expected number of detectors get imported!
   imp.ImportGeometry(fImport_dTheta, fImport_dPhi, fImport_ThetaMin, fImport_PhiMin, fImport_ThetaMax, fImport_PhiMax);

   /*
   KVFAZIADetector* det=0;
   TIter next_d(GetDetectors());
   while ( det = (KVFAZIADetector* )next_d() ){
      printf("%s %s %d %d %d\n",det->GetName(),det->GetFAZIAType(),det->GetBlockNumber(),det->GetQuartetNumber(),det->GetTelescopeNumber());
   }
   */
   SetIdentifications();
   SortIDTelescopes();
   KVDetector* det = GetDetector("SI2-T1-Q1-B001");
   det->GetIDTelescopes()->ls();



   SetDetectorThicknesses();
   SetBit(kIsBuilt);
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:52,代码来源:KVFAZIA.cpp

示例2: GetDetector

//___________________________________________________________________________
Double_t KVChannelVolt::Compute(Double_t chan) const
{
   Double_t gain = 1.;
   KVDetector* det = GetDetector();
   if (det)
      gain = det->GetGain();
   //Calculate the calibrated signal strength in volts for a given channel number.
   if (fReady) {
      return (fPar[0] + fPar[1] * chan + fPar[2] * chan * chan) * gain_ref / gain;
   } else {
      return 0.;
   }
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:14,代码来源:KVChannelVolt.cpp

示例3: next

TList* KVGroup::GetDetectorsInLayer(UInt_t lay)
{
   // lay=1 : create and fill list with detectors closest to target
   // lay=GetNumberOfDetectorLayers() : detectors furthest from target

   TList* dets = new TList;
   TIter next(GetDetectors());
   KVDetector* d;

   while ((d = (KVDetector*)next())) {
      if (lay == (UInt_t)d->GetAlignedDetectors()->GetEntries()) dets->Add(d);
   }
   return dets;
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:14,代码来源:KVGroup.cpp

示例4: GetDetector

Bool_t KVIDTelescope::CheckTheoreticalIdentificationThreshold(KVNucleus* ION, Double_t EINC)
{
   // Return kTRUE if energy of ION is > minimum incident energy required for identification
   // This theoretical limit is defined here to be the incident energy for which the
   // dE in the first detector of a dE-E telescope is maximum.
   // If EINC>0 it is assumed to be the energy of the ion just before the first detector
   // (case where ion would have to pass other detectors before reaching this telescope).
   //
   // If this is not a dE-E telescope, we return kTRUE by default.

   if (GetSize() < 2) return kTRUE;

   KVDetector* dEdet = GetDetector(1);
   Double_t emin = dEdet->GetEIncOfMaxDeltaE(ION->GetZ(), ION->GetA());
   if (EINC > 0.0) return (EINC > emin);
   return (ION->GetEnergy() > emin);
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:17,代码来源:KVIDTelescope.cpp

示例5: next_det

const Char_t* KVINDRATelescope::GetArrayName()
{
   // Name of telescope given in the form Det1_Det2_..._Ring-numberTelescope-number
   // where Det1 etc. are the ACTIVE detector layers of the telescope
   // The detectors are signified by their TYPE names i.e. KVDetector::GetType

   TIter next_det(GetDetectors());
   KVDetector* kdet;
   TString dummy;
   while ((kdet = (KVDetector*) next_det())) {  //loop over detectors in telescope
      if (dummy == "")
         dummy = kdet->GetType();
      else
         dummy += kdet->GetType();
      dummy += "_";
   }
   fName.Form("%s%02d%02d", dummy.Data(), GetRingNumber(), GetNumber());
   return fName.Data();
}
开发者ID:FableQuentin,项目名称:kaliveda,代码行数:19,代码来源:KVINDRATelescope.cpp

示例6: SetChVoltParameters

void KVINDRAUpDater::SetChVoltParameters(KVDBRun* kvrun)
{


   KVRList* param_list = kvrun->GetLinks("Channel-Volt");
   if (!param_list)
      return;
   if (!param_list->GetSize())
      return;

   KVDetector* kvd;
   KVDBParameterSet* kvps;
   KVCalibrator* kvc;
   TIter next_ps(param_list);


   TString str;

   // Setting Channel-Volts calibration parameters
   while ((kvps = (KVDBParameterSet*) next_ps())) {     // boucle sur les parametres
      str = kvps->GetName();
      str.Remove(str.Sizeof() - 4, 3);  //Removing 3 last letters (ex : "_PG")
      kvd = fArray->GetDetector(str.Data());
      if (!kvd)
         Warning("SetChVoltParameters(UInt_t)", "Dectector %s not found !",
                 str.Data());
      else {                    // detector found
         kvc = kvd->GetCalibrator(kvps->GetName(), kvps->GetTitle());
         if (!kvc)
            Warning("SetChVoltParameters(UInt_t)",
                    "Calibrator %s %s not found !", kvps->GetName(),
                    kvps->GetTitle());
         else {                 //calibrator found
            for (Int_t i = 0; i < kvc->GetNumberParams(); i++) {
               kvc->SetParameter(i, kvps->GetParameter(i));
            }
            kvc->SetStatus(kTRUE);   // calibrator ready
         }                      //calibrator found
      }                         //detector found
   }                            //boucle sur les parameters
}
开发者ID:FableQuentin,项目名称:kaliveda,代码行数:41,代码来源:KVINDRAUpDater.cpp

示例7: next_det

//_________________________________________________________________________________________
void KVINDRA::FillListsOfDetectorsByType()
{
   //Fill lists of ChIo, Si, CsI and phoswich

   fChIo->Clear();
   fSi->Clear();
   fCsI->Clear();
   fPhoswich->Clear();
   TIter next_det(GetDetectors());
   KVDetector* kvd;
   while ((kvd = (KVDetector*) next_det())) {
      kvd->SetNameOfArray("INDRA");
      if (kvd->InheritsFrom("KVChIo")) {
         fChIo->Add(kvd);
      }
      if (kvd->InheritsFrom("KVSilicon")) {
         fSi->Add(kvd);
      }
      if (kvd->InheritsFrom("KVCsI")) {
         fCsI->Add(kvd);
      }
      if (kvd->InheritsFrom("KVPhoswich")) {
         fPhoswich->Add(kvd);
      }
   }
}
开发者ID:FableQuentin,项目名称:kaliveda,代码行数:27,代码来源:KVINDRA.cpp

示例8: SetVoltEnergyChIoSiParameters

void KVINDRAUpDater::SetVoltEnergyChIoSiParameters(KVDBRun* kvrun)
{

   KVRList* param_list = kvrun->GetLinks("Volt-Energy ChIo-Si");
   if (!param_list)
      return;
   if (!param_list->GetSize()) {
      return;
   }

   KVDetector* kvd;
   KVDBParameterSet* kvps;
   KVCalibrator* kvc;
   TIter next_ps(param_list);

   // Setting Channel-Volts calibration parameters
   while ((kvps = (KVDBParameterSet*) next_ps())) {     // boucle sur les parametres
      kvd = fArray->GetDetector(kvps->GetName());
      if (!kvd) {
         /*
         Warning("SetVoltEnergyParameters(UInt_t)",
                 "Dectector %s not found !", kvps->GetName());
         */
      }
      else {                    // detector found
         kvc = kvd->GetCalibrator(kvps->GetName(), kvps->GetTitle());
         if (!kvc)
            Warning("SetVoltEnergyParameters(UInt_t)",
                    "Calibrator %s %s not found !", kvps->GetName(),
                    kvps->GetTitle());
         else {                 //calibrator found
            for (Int_t i = 0; i < kvc->GetNumberParams(); i++) {
               kvc->SetParameter(i, kvps->GetParameter(i));
            }
            kvc->SetStatus(kTRUE);      // calibrator ready
         }                      //calibrator found
      }                         //detector found
   }                            //boucle sur les parameters
}
开发者ID:FableQuentin,项目名称:kaliveda,代码行数:39,代码来源:KVINDRAUpDater.cpp

示例9: Error

void KVINDRAUpDater_e475s::SetCalibrationParameters(UInt_t run){


    //Set calibration parameters for this run.
    //This will:
    //      remove all the calibrators of all the detectors ready to receive the calibrators for the run (handled by child classes),
    //      set calibration parameters for the run
    //      set pedestals for the run
    
    cout << "Setting calibration parameters of INDRA array for run " << run << ":" <<
    endl;
    KVDBRun *kvrun = gIndraDB->GetRun(run);
    if (!kvrun)
    {
        Error("SetParameters(UInt_t)", "Run %u not found in database!", run);
        return;
    }
    //Reset all calibrators of all detectors first
    TIter next(gIndra->GetListOfDetectors());
    KVDetector *kvd;
    while ((kvd = (KVDetector *) next()))
    {
      if (kvd->InheritsFrom("KVSiLi") || kvd->InheritsFrom("KVSi75")){
		 	if (kvd->GetListOfCalibrators())
			kvd->RemoveCalibrators();
		 	kvd->SetCalibrators();
		  }
		 else {
		  if (kvd->GetListOfCalibrators())
        {
            kvd->RemoveCalibrators();
				TIter lacq(kvd->GetACQParamList());
				KVACQParam* acq = 0;
				while ( (acq = (KVACQParam* )lacq()) ){
					acq->SetPedestal(0);
				}
		  }
    	}
	 }
    SetCalibParameters(kvrun);
    SetPedestals(kvrun);

}
开发者ID:pwigg,项目名称:kaliveda,代码行数:43,代码来源:KVINDRAUpDater_e475s.cpp

示例10: FillHistograms

void KVElasticCountRates::FillHistograms(KVNameValueList* dets)
{
   // parse the list dets
   // fill histograms with energy loss for all detectors
   // clear the detector energy losses
   // delete the list

   if (!dets) return;

   Int_t ndets = dets->GetNpar();
   for (int i = 0; i < ndets; i++) {
      TString detname = dets->GetNameAt(i);
      KVDetector* det = gMultiDetArray->GetDetector(detname);
      if (!det) continue;
      TH1F* histo = (TH1F*)fHistos.FindObject(detname);
      if (!histo) {
         histo = new TH1F(detname, Form("Eloss in %s", detname.Data()), fBinE, 0, 0);
         fHistos.Add(histo);
      }
      double de = dets->GetDoubleValue(i);
      histo->Fill(de, xsec * sin(theta * TMath::DegToRad()));
      histo = (TH1F*)fHistos.FindObject(detname + "_dW");
      if (!histo) {
         histo = new TH1F(detname + "_dW", Form("Solid angle of %s", detname.Data()), fBinE, 0, 0);
         fHistos.Add(histo);
      }
      histo->Fill(de, sin(theta * TMath::DegToRad()));
      TH2F* histo2 = (TH2F*)fHistos.FindObject(detname + "_map");
      if (!histo2) {
         histo2 = new TH2F(detname + "_map", Form("Map of %s", detname.Data()), 100, 0, 0, 100, 0, 0);
         fHistos.Add(histo2);
      }
      histo2->Fill(theta, phi, xsec);
      det->Clear();
   }
   delete dets;
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:37,代码来源:KVElasticCountRates.cpp

示例11: next_par

void KVFAZIA::GetDetectorEvent(KVDetectorEvent* detev, TSeqCollection* signals)
{
   // First step in event reconstruction based on current status of detectors in array.
   // Fills the given KVDetectorEvent with the list of all groups which have fired.
   // i.e. loop over all groups of the array and test whether KVGroup::Fired() returns true or false.
   //
   // If the list of fired acquisition parameters 'signals' is given, KVMultiDetArray::GetDetectorEvent
   // is called
   //

   if (signals) {
      // list of fired acquisition parameters given
      TIter next_par(signals);

      KVSignal* par = 0;
      KVDetector* det = 0;
      KVGroup* grp = 0;
      while ((par = (KVSignal*)next_par())) {
         if (!(par->GetN() > 0))
            Info("GetDetectorEvent", "%s empty", par->GetName());
         par->DeduceFromName();
         if ((det = GetDetector(par->GetDetectorName()))) {
            ((KVFAZIADetector*)det)->SetSignal(par, par->GetType());
            if ((!(((KVFAZIADetector*)det)->GetSignal(par->GetType())->GetN() > 0)))
               Warning("Error", "%s %s empty signal is returned", det->GetName(), par->GetType());
            if ((grp = det->GetGroup())  && !detev->GetGroups()->FindObject(grp)) {
               detev->AddGroup(grp);
            }
         } else {
            Error("GetDetectedEvent", "Unknown detector %s !!!", par->GetDetectorName());
         }
      }
   } else {
      KVMultiDetArray::GetDetectorEvent(detev, 0);
   }

}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:37,代码来源:KVFAZIA.cpp

示例12: GetDetector

//___________________________________________________________________________
Double_t KVChannelVolt::Invert(Double_t volts)
{
   //Given the calibrated (or simulated) signal amplitude in volts,
   //calculate the corresponding channel number according to the
   //calibration parameters (useful for filtering simulations).

   Double_t gain = 1.;
   KVDetector* det = GetDetector();
   if (det)
      gain = det->GetGain();
   Int_t channel = 0;

   if (fReady) {
      if (fPar[2]) {
         // quadratic transfer function
         Double_t c;
         c = fPar[1] * fPar[1] - 4. * fPar[2] * (fPar[0] - gain / gain_ref * volts);
         if (c < 0.0)
            return -1;
         c = (-fPar[1] + TMath::Sqrt(c)) / (2.0 * fPar[2]);
         if (c < 0.0
               && ((-fPar[1] - TMath::Sqrt(c)) / (2.0 * fPar[2])) > 0.0) {
            c = (-fPar[1] - TMath::Sqrt(c)) / (2.0 * fPar[2]);
         }
         channel = (Int_t)(c + 0.5);
      }
      else {
         // linear transfer function
         channel = (Int_t)(0.5 + (gain / gain_ref * volts - fPar[0]) / fPar[1]);
      }
   }
   else {
      Warning("Compute", "Parameters not correctly initialized");
   }
   return (Double_t) channel;
}
开发者ID:FableQuentin,项目名称:kaliveda,代码行数:37,代码来源:KVChannelVolt.cpp

示例13: GetCurrentDetector

void KVGeoImport::ParticleEntersNewVolume(KVNucleus *)
{
    // All detectors crossed by the particle's trajectory are added to the multidetector
    // and the groups (KVGroup) of aligned detectors are set up

    KVDetector* detector = GetCurrentDetector();
    if(!detector) return;
	 Bool_t group_inconsistency = kFALSE;
    if(fCreateArray){
        if(!fCurrentGroup){
            if(detector->GetGroup()) {
                fCurrentGroup=detector->GetGroup();
            }
            else {
                fCurrentGroup = new KVGroup;
                fCurrentGroup->SetNumber(++fGroupNumber);
                fCurrentGroup->Add(detector);
                fArray->Add(fCurrentGroup);
            }
        }
        else
        {
            KVGroup* det_group = detector->GetGroup();
            if(!det_group) {
                fCurrentGroup->Add(detector);
            }
            else {
                if(det_group!=fCurrentGroup){
//                     Warning("ParticleEntersNewVolume",
//                             "Detector %s : already belongs to %s, now seems to be in %s",
//                             detector->GetName(), det_group->GetName(),
//                             fCurrentGroup->GetName());
						  group_inconsistency = kTRUE;
					 }
            }
        }
    }
    detector->GetNode()->SetName(detector->GetName());
	 if(fLastDetector && detector!=fLastDetector && !group_inconsistency) {
        fLastDetector->GetNode()->AddBehind(detector);
        detector->GetNode()->AddInFront(fLastDetector);
    }
    fLastDetector = detector;
}
开发者ID:pwigg,项目名称:kaliveda,代码行数:44,代码来源:KVGeoImport.cpp

示例14: SearchAndOpenKVFile

void KVINDRAUpDater::SetChIoSiPedestals(KVDBRun* kvrun)
{
   //read Chio-Si-Etalons pedestals

   if (!kvrun->GetKey("Pedestals"))
      return;
   if (!kvrun->GetKey("Pedestals")->GetLinks())
      return;
   if (!kvrun->GetKey("Pedestals")->GetLinks()->At(0))
      return;

   ifstream file_pied_chiosi;
   if (!KVBase::
         SearchAndOpenKVFile(kvrun->GetKey("Pedestals")->GetLinks()->At(0)->
                             GetName(), file_pied_chiosi, fDataSet.Data())) {
      Error("SetPedestals", "Problem opening file %s",
            kvrun->GetKey("Pedestals")->GetLinks()->At(0)->GetName());
      return;
   }
   cout << "--> Setting Pedestals" << endl;
   cout << "    ChIo/Si/Etalons: " << kvrun->GetKey("Pedestals")->
        GetLinks()->At(0)->GetName() << endl;

   //skip first 5 lines - header
   TString line;
   for (int i = 5; i; i--) {
      line.ReadLine(file_pied_chiosi);
   }

   int cou, mod, type, n_phys, n_gene;
   float ave_phys, sig_phys, ave_gene, sig_gene;

   while (file_pied_chiosi.good()) {

      file_pied_chiosi >> cou >> mod >> type >> n_phys >> ave_phys >>
                       sig_phys >> n_gene >> ave_gene >> sig_gene;

      KVDetector* det = GetINDRA()->GetDetectorByType(cou, mod, type);
      if (det) {
         switch (type) {

            case ChIo_GG:

               det->SetPedestal("GG", ave_gene);
               break;

            case ChIo_PG:

               det->SetPedestal("PG", ave_gene);
               break;

            case Si_GG:

               det->SetPedestal("GG", ave_gene);
               break;

            case Si_PG:

               det->SetPedestal("PG", ave_gene);
               break;

            case SiLi_GG:

               det->SetPedestal("GG", ave_gene);
               break;

            case SiLi_PG:

               det->SetPedestal("PG", ave_gene);
               break;

            case Si75_GG:

               det->SetPedestal("GG", ave_gene);
               break;

            case Si75_PG:

               det->SetPedestal("PG", ave_gene);
               break;

            default:

               break;
         }
      }
   }
   file_pied_chiosi.close();
}
开发者ID:FableQuentin,项目名称:kaliveda,代码行数:89,代码来源:KVINDRAUpDater.cpp

示例15: next_ps

void KVINDRAUpDater::SetLitEnergyCsIParameters(KVDBRun* kvrun)
{

   // Setting Light- Energy CsI calibration parameters for Z=1
   KVRList* param_list = kvrun->GetLinks("Light-Energy CsI Z=1");

   if (param_list && param_list->GetSize()) {

      KVDetector* kvd;
      KVDBParameterSet* kvps;
      KVCalibrator* kvc;
      TIter next_ps(param_list);
      TString str;

      while ((kvps = (KVDBParameterSet*) next_ps())) {     // boucle sur les parametres
         str = kvps->GetName();
         kvd = fArray->GetDetector(str.Data());
         if (!kvd)
            Warning("SetLitEnergyCsIParameters(UInt_t)",
                    "Dectector %s not found !", str.Data());
         else {                    // detector found
            kvc = kvd->GetCalibrator(kvps->GetTitle());
            if (!kvc) {
               Warning("SetLitEnergyCsIParameters(UInt_t)",
                       "Calibrator %s %s not found ! - it will be created",
                       kvps->GetName(), kvps->GetTitle());
               kvd->SetCalibrators();
               kvc = kvd->GetCalibrator(kvps->GetTitle());
            }
            for (Int_t i = 0; i < kvc->GetNumberParams(); i++) {
               kvc->SetParameter(i, kvps->GetParameter(i));
               kvc->SetStatus(kTRUE);      // calibrator ready
            }
         }                         //detector found
      }                            //boucle sur les parameters
   }
   // Setting Light- Energy CsI calibration parameters for Z>1
   param_list = kvrun->GetLinks("Light-Energy CsI Z>1");

   if (!param_list || !param_list->GetSize()) {
      return;
   }

   KVDetector* kvd;
   KVDBParameterSet* kvps;
   KVCalibrator* kvc;
   TString str;

   TIter next_ps2(param_list);
   while ((kvps = (KVDBParameterSet*) next_ps2())) {     // boucle sur les parametres
      str = kvps->GetName();
      kvd = fArray->GetDetector(str.Data());
      if (!kvd)
         Warning("SetLitEnergyCsIParameters(UInt_t)",
                 "Dectector %s not found !", str.Data());
      else {                    // detector found
         kvc = kvd->GetCalibrator(kvps->GetTitle());
         if (!kvc) {
            Warning("SetLitEnergyCsIParameters(UInt_t)",
                    "Calibrator %s %s not found ! - it will be created",
                    kvps->GetName(), kvps->GetTitle());
            kvd->SetCalibrators();
            kvc = kvd->GetCalibrator(kvps->GetTitle());
         }
         for (Int_t i = 0; i < kvc->GetNumberParams(); i++) {
            kvc->SetParameter(i, kvps->GetParameter(i));
            kvc->SetStatus(kTRUE);      // calibrator ready
         }
      }                         //detector found
   }                            //boucle sur les parameters
}
开发者ID:FableQuentin,项目名称:kaliveda,代码行数:71,代码来源:KVINDRAUpDater.cpp


注:本文中的KVDetector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。