FEDRA emulsion software from the OPERA Collaboration
EdbShowerAlgIDSimple Class Reference

#include <EdbShowerAlg.h>

Inheritance diagram for EdbShowerAlgIDSimple:
Collaboration diagram for EdbShowerAlgIDSimple:

Public Member Functions

 ClassDef (EdbShowerAlgIDSimple, 1)
 
void CreateANN ()
 
Int_t DetermineIDFlag (Int_t IDType)
 
Int_t DetermineIDType (Double_t val, Int_t SpecificationType)
 
void DoRun ()
 
void DoRun (EdbTrackP *)
 
void DoRun (TObjArray *trackarray)
 
 EdbShowerAlgIDSimple ()
 
 EdbShowerAlgIDSimple (EdbTrackP *track)
 CONSTRUCTOR USED FOR libShowRec with EdbShowerP class available. More...
 
 EdbShowerAlgIDSimple (EdbTrackP *track, EdbVertex *vtx)
 
 EdbShowerAlgIDSimple (TObjArray *RecoShowerArray)
 
 EdbShowerAlgIDSimple (TObjArray *RecoShowerArray, TObjArray *VtxArray)
 
void Help ()
 
void Init ()
 
void InitStrings ()
 
void Print ()
 
void PrintSpecifications ()
 
void ReadTables ()
 
void ReadTables_ID ()
 
void SetANNIDCutValue (Double_t ANNIDCutValue)
 
void SetSpecificationType (Int_t SpecificationType, Int_t SpecificationTypeVal)
 
void Update ()
 
virtual ~EdbShowerAlgIDSimple ()
 virtual constructor due to inherited class More...
 
- Public Member Functions inherited from EdbShowerAlgESimple
 ClassDef (EdbShowerAlgESimple, 1)
 
void CreateANN ()
 
void DoRun ()
 
void DoRun (EdbTrackP *shower)
 
void DoRun (TObjArray *trackarray)
 
void DumpNeuralNetworkWeight (TString weight, Int_t ANNType=0)
 
 EdbShowerAlgESimple ()
 
 EdbShowerAlgESimple (EdbTrackP *track)
 in libShower More...
 
 EdbShowerAlgESimple (TObjArray *RecoShowerArray)
 
Int_t FindClosestEfficiencyParametrization (Double_t TestAngle, Double_t ReferenceEff)
 
TF1 * GetEffFunc_all ()
 
TF1 * GetEffFunc_edefault ()
 
TF1 * GetEffFunc_elletroni ()
 
TF1 * GetEffFunc_LowEff ()
 
TF1 * GetEffFunc_MiddleFix ()
 
TF1 * GetEffFunc_neuchmicro ()
 
TF1 * GetEffFunc_UserEfficiency ()
 
TSpline3 * GetEfficiencyParametrisation ()
 
Float_t GetEnergy ()
 
Float_t GetEnergy (EdbTrackP *track)
 
TArrayF * GetEnergyArray ()
 
TArrayF * GetEnergyArrayUnCorrected ()
 
TMultiLayerPerceptron * GetNeuralNetwork (Int_t ANNType=0)
 
void GetNplIndexNr (Int_t sh_npl, Int_t &check_Npl_index, Int_t ePlateNumberType)
 
void GetPara (EdbTrackP *track)
 
Int_t GetRecoShowerArrayN () const
 
void GetSpecifications ()
 
Int_t GetSpecType (Int_t SpecificationType)
 
void Help ()
 
void InitStrings ()
 
void LoadSpecificationWeightFile ()
 
void Print ()
 
void PrintEfficiencyParametrisation ()
 
void PrintSpecifications ()
 
void ReadCorrectionFactors (TString weigthstring, Float_t &p0, Float_t &p1)
 
void ReadTables ()
 
void ReadTables_Energy ()
 
void SetCalibrationOffset (Float_t CalibrationOffset)
 
void SetCalibrationSlope (Float_t CalibrationSlope)
 
void SetEfficiencyParametrisation (TSpline3 *EfficiencyParametrisation)
 
void SetEfficiencyParametrisationAngles ()
 
void SetEfficiencyParametrisationValues (Double_t *Angles, Double_t *EffValuesAtAngles)
 
void SetForceSpecificationReload ()
 
void SetPlateNumber (Int_t PlateNumber)
 
void SetPlateNumberType (Int_t PlateNumberType)
 
void SetRecoShowerArray (TObjArray *RecoShowerArray)
 
void SetRecoShowerArrayN (Int_t RecoShowerArrayN)
 
void SetSpecifications (Int_t sp0, Int_t sp1, Int_t sp2, Int_t sp3, Int_t sp4, Int_t sp5)
 
void SetSpecificationType (Int_t SpecificationType, Int_t SpecificationTypeVal)
 
void SetWeightFileString (TString weightstring)
 
void TrainNeuralNetwork (TString weight, Int_t ANNType=0)
 
void UnSetForceSpecificationReload ()
 
void Update ()
 
void WriteNewRootFile ()
 
void WriteNewRootFile (TString sourcefilename)
 
void WriteNewRootFile (TString sourcefilename, TString treename)
 
virtual ~EdbShowerAlgESimple ()
 virtual constructor due to inherited class More...
 

Protected Attributes

Double_t eANNIDCutValue
 
Double_t eIDCutTypeValue [3]
 
Double_t eIDEnergySigmaCorr
 
- Protected Attributes inherited from EdbShowerAlgESimple
TString ANN_Layout
 
TMultiLayerPerceptron * ANN_MLP
 
TMultiLayerPerceptron * ANN_MLP_ARRAY [15]
 
Int_t ANN_n_InputNeurons
 
Int_t ANN_n_InputNeurons_ARRAY [15]
 
Int_t ANN_nPlates_ARRAY [15]
 
TString ANN_WeightFile_ARRAY [15]
 
TTree * ANNTree
 
Float_t eANN_MLP_CORR_0 [15]
 
Float_t eANN_MLP_CORR_1 [15]
 
Float_t eCalibrationOffset
 
Float_t eCalibrationSlope
 
TSpline3 * eEfficiencyParametrisation
 
Float_t eEnergy
 
TArrayF * eEnergyArray
 
Int_t eEnergyArrayCount
 
TArrayF * eEnergyArraySigmaCorrected
 
TArrayF * eEnergyArrayUnCorrected
 
Float_t eEnergyCorr
 
Float_t eEnergySigmaCorr
 
Float_t eEnergyUnCorr
 
TF1 * EffFunc_all
 
TF1 * EffFunc_edefault
 
TF1 * EffFunc_elletroni
 
TF1 * EffFunc_LowEff
 
TF1 * EffFunc_MiddleFix
 
TF1 * EffFunc_neuchmicro
 
TF1 * EffFunc_UserEfficiency
 
Bool_t eForceSpecificationReload
 
TH1D * eHisto_deltaR
 
TH1D * eHisto_deltaR_mean
 
TH1D * eHisto_deltaR_rms
 
TH1D * eHisto_deltaT
 
TH1D * eHisto_deltaT_mean
 
TH1D * eHisto_deltaT_rms
 
TH1D * eHisto_longprofile
 
TH1D * eHisto_longprofile_av
 
TH1D * eHisto_nbtk
 
TH1D * eHisto_nbtk_av
 
TH1D * eHisto_transprofile
 
TH1D * eHisto_transprofile_av
 
Float_t eParaBT_deltaR_mean
 
Float_t eParaBT_deltaR_rms
 
Float_t eParaBT_deltaT_mean
 
Float_t eParaBT_deltaT_rms
 
Int_t eParalongprofile [57]
 
Int_t eParaName
 
Int_t eParanseg
 
Float_t eParaShowerAxisAngle
 
Int_t ePlateBinning [15]
 
Int_t ePlateNumber
 
Int_t ePlateNumberType
 
TObjArray * eRecoShowerArray
 
Int_t eRecoShowerArrayN
 
Bool_t eSpecificationIsChanged
 
Int_t eSpecificationType [7]
 
TString eSpecificationTypeString [7]
 
TString eSpecificationTypeStringArray [7][7]
 
TObjArray * eSplineArray_Energy_Stat_Electron
 
TObjArray * eSplineArray_Energy_Stat_Gamma
 
TObjArray * eSplineArray_Energy_Sys_Electron
 
TObjArray * eSplineArray_Energy_Sys_Gamma
 
TSpline3 * eSplineCurrent
 
TString eWeightFileString
 
Double_t inANN [70]
 
Double_t outANN
 

Additional Inherited Members

- Protected Member Functions inherited from EdbShowerAlgESimple
void Init ()
 
void Set0 ()
 

Constructor & Destructor Documentation

◆ EdbShowerAlgIDSimple() [1/5]

EdbShowerAlgIDSimple::EdbShowerAlgIDSimple ( )

Default Constructor

4122{
4124 if (gEDBDEBUGLEVEL >1) cout << "EdbShowerAlgIDSimple::EdbShowerAlgIDSimple() Default Constructor"<<endl;
4125 Set0();
4126 Init();
4127 cout << "EdbShowerAlgIDSimple::EdbShowerAlgIDSimple() Default Constructor...done."<<endl;
4128}
void Set0()
Definition: EdbShowerAlg.cxx:2529
void Init()
Definition: EdbShowerAlg.cxx:4458
gEDBDEBUGLEVEL
Definition: energy.C:7

◆ EdbShowerAlgIDSimple() [2/5]

EdbShowerAlgIDSimple::EdbShowerAlgIDSimple ( EdbTrackP track)

CONSTRUCTOR USED FOR libShowRec with EdbShowerP class available.

Default Constructor...

4150{
4152 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::EdbShowerAlgIDSimple(EdbTrackP* track) Default Constructor"<<endl;
4153 Set0();
4154 Init();
4155 // ... with Shower:
4156 eRecoShowerArray=new TObjArray();
4157 eRecoShowerArray->Add(track);
4159 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::EdbShowerAlgIDSimple(EdbTrackP* track) Default Constructor...done."<<endl;
4160}
void SetRecoShowerArrayN(Int_t RecoShowerArrayN)
Definition: EdbShowerAlg.h:452
TObjArray * eRecoShowerArray
Definition: EdbShowerAlg.h:332
Definition: bitview.h:14

◆ EdbShowerAlgIDSimple() [3/5]

EdbShowerAlgIDSimple::EdbShowerAlgIDSimple ( TObjArray *  RecoShowerArray)

Default Constructor

4166{
4168 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::EdbShowerAlgIDSimple(TObjArray* RecoShowerArray) Default Constructor"<<endl;
4169 Set0();
4170 Init();
4171 // ... with ShowerArray:
4173 eRecoShowerArrayN=eRecoShowerArray->GetEntries();
4174 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::EdbShowerAlgIDSimple(TObjArray* RecoShowerArray) Default Constructor...done."<<endl;
4175}
TObjArray * RecoShowerArray
Definition: Shower_E_FromShowerRoot.C:12
Int_t eRecoShowerArrayN
Definition: EdbShowerAlg.h:333

◆ EdbShowerAlgIDSimple() [4/5]

EdbShowerAlgIDSimple::EdbShowerAlgIDSimple ( EdbTrackP track,
EdbVertex vtx 
)

Default Constructor...

4180{
4182 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::EdbShowerAlgIDSimple(EdbTrackP* track, EdbVertex* vtx) Default Constructor"<<endl;
4183 Set0();
4184 Init();
4185 // ... with Shower:
4186 eRecoShowerArray=new TObjArray();
4187 eRecoShowerArray->Add(track);
4189 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::EdbShowerAlgIDSimple(EdbTrackP* track, EdbVertex* vtx) Default Constructor...done."<<endl;
4190}

◆ EdbShowerAlgIDSimple() [5/5]

EdbShowerAlgIDSimple::EdbShowerAlgIDSimple ( TObjArray *  RecoShowerArray,
TObjArray *  VtxArray 
)

Default Constructor

4196{
4198 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::EdbShowerAlgIDSimple(TObjArray* RecoShowerArray, TObjArray* VtxArray) Default Constructor"<<endl;
4199 Set0();
4200 Init();
4201 // ... with ShowerArray:
4203 eRecoShowerArrayN=eRecoShowerArray->GetEntries();
4204 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::EdbShowerAlgIDSimple(TObjArray* RecoShowerArray, TObjArray* VtxArray) Default Constructor...done."<<endl;
4205}

◆ ~EdbShowerAlgIDSimple()

EdbShowerAlgIDSimple::~EdbShowerAlgIDSimple ( )
virtual

virtual constructor due to inherited class

Default Destructor

4210{
4212 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::~EdbShowerAlgIDSimple()"<<endl;
4213 // Delete Histograms (on heap):
4214 delete eHisto_nbtk_av;
4215 delete eHisto_longprofile_av;
4217 delete eHisto_deltaR_mean;
4218 delete eHisto_deltaT_mean;
4219 delete eHisto_deltaR_rms;
4220 delete eHisto_deltaT_rms;
4221 delete eHisto_nbtk;
4222 delete eHisto_longprofile;
4223 delete eHisto_transprofile;
4224 delete eHisto_deltaR;
4225 delete eHisto_deltaT;
4226 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::~EdbShowerAlgIDSimple()...done."<<endl;
4227}
TH1D * eHisto_longprofile
Definition: EdbShowerAlg.h:395
TH1D * eHisto_deltaT
Definition: EdbShowerAlg.h:398
TH1D * eHisto_nbtk
Definition: EdbShowerAlg.h:394
TH1D * eHisto_deltaR
Definition: EdbShowerAlg.h:397
TH1D * eHisto_transprofile_av
Definition: EdbShowerAlg.h:389
TH1D * eHisto_transprofile
Definition: EdbShowerAlg.h:396
TH1D * eHisto_nbtk_av
Definition: EdbShowerAlg.h:387
TH1D * eHisto_deltaT_rms
Definition: EdbShowerAlg.h:393
TH1D * eHisto_longprofile_av
Definition: EdbShowerAlg.h:388
TH1D * eHisto_deltaT_mean
Definition: EdbShowerAlg.h:391
TH1D * eHisto_deltaR_rms
Definition: EdbShowerAlg.h:392
TH1D * eHisto_deltaR_mean
Definition: EdbShowerAlg.h:390

Member Function Documentation

◆ ClassDef()

EdbShowerAlgIDSimple::ClassDef ( EdbShowerAlgIDSimple  ,
 
)

◆ CreateANN()

void EdbShowerAlgIDSimple::CreateANN ( )

Compared to EdbShowerAlgESimple this ANN has two BIG differences:
a) It 2 InputNeurons more (vtxIP, vtxDeltaZ)
b) :inANN[0]/1000 is changed to :inANN[0] (int instead of float variable)

4592{
4593 if (gEDBDEBUGLEVEL >1) cout << "EdbShowerAlgIDSimple::CreateANN()"<<endl;
4594
4598
4599
4600 // Create ANN Tree and MLP:
4601 eParaName=2; // Standard Labeling taken over from EdbShowerP
4602 ANNTree = new TTree("ANNTree", "ANNTree");
4603 ANNTree->SetDirectory(0);
4604 ANNTree->Branch("inANN", inANN, "inANN[70]/D");
4605
4606 // Plate Binning: 10,12,14,16,18,20,23,26,29,32,35,40,45,45
4607 // see ePlateBinning[]
4608 for (int k=0; k<15; k++) {
4609// for (int k=0; k<1; k++) {
4610 cout << "EdbShowerAlgIDSimple::CreateANN() Number k= " << k << endl;
4611 ANN_Layout="";
4612 ANN_n_InputNeurons_ARRAY[k]=6+ePlateBinning[k]+2; // Two extra for ID (vtxIP, vtxDeltaZ)
4614 cout << "EdbShowerAlgIDSimple::CreateANN() Number ANN_n_InputNeurons= " << ANN_n_InputNeurons << endl;
4615
4616 for (Int_t i=1; i<ANN_n_InputNeurons; ++i) ANN_Layout += "@inANN["+TString(Form("%d",i))+"],";
4617 ANN_Layout += "@inANN["+TString(Form("%d",ANN_n_InputNeurons))+"]:"+TString(Form("%d",ANN_n_InputNeurons+1))+":"+TString(Form("%d",ANN_n_InputNeurons));
4618 ANN_Layout+=":inANN[0]";
4619 //---------------------------
4620 ANN_MLP_ARRAY[k] = new TMultiLayerPerceptron(ANN_Layout,ANNTree,"","");
4622 ANN_Layout=ANN_MLP_ARRAY[k]->GetStructure();
4623 //---------------------------
4624 if (gEDBDEBUGLEVEL>2) {
4625 ANN_MLP->Print();
4626 cout << ANN_Layout << endl;
4627 }
4628 }
4629 //---------------------------
4630
4631 if (gEDBDEBUGLEVEL >1) cout << "EdbShowerAlgIDSimple::CreateANN()...done."<<endl;
4632 return;
4633}
TString ANN_Layout
Definition: EdbShowerAlg.h:369
Double_t inANN[70]
Definition: EdbShowerAlg.h:364
TTree * ANNTree
Definition: EdbShowerAlg.h:363
Int_t ePlateBinning[15]
Definition: EdbShowerAlg.h:358
Int_t ANN_n_InputNeurons
Definition: EdbShowerAlg.h:368
Int_t ANN_n_InputNeurons_ARRAY[15]
Definition: EdbShowerAlg.h:367
TMultiLayerPerceptron * ANN_MLP_ARRAY[15]
Definition: EdbShowerAlg.h:362
Int_t eParaName
Definition: EdbShowerAlg.h:334
TMultiLayerPerceptron * ANN_MLP
Definition: EdbShowerAlg.h:361

◆ DetermineIDFlag()

Int_t EdbShowerAlgIDSimple::DetermineIDFlag ( Int_t  IDType)
4783{
4784 if (gEDBDEBUGLEVEL >1) cout << "EdbShowerAlgIDSimple::DetermineIDFlag()" << endl;
4785
4786 // Depending on the SHID<->SPID type we assign the ID output into
4787 // 22, -11, -211 (PdgIds of Gamma,Electron,Pion)
4788
4789 Int_t Flag=0;
4790 if (eSpecificationType[1]==2) {
4791 if (IDType==0) Flag=-211;
4792 if (IDType==1) Flag=22;
4793 }
4794 else if (eSpecificationType[1]==1) {
4795 if (IDType==0) Flag=-11;
4796 if (IDType==1) Flag=-211;
4797 }
4798 else {
4799 if (IDType==0) Flag=22;
4800 if (IDType==1) Flag=-11;
4801 }
4802 return Flag;
4803}
Int_t eSpecificationType[7]
Definition: EdbShowerAlg.h:350

◆ DetermineIDType()

Int_t EdbShowerAlgIDSimple::DetermineIDType ( Double_t  val,
Int_t  SpecificationType 
)
4771{
4772 if (gEDBDEBUGLEVEL >1) cout << "EdbShowerAlgIDSimple::DetermineIDType()" << endl;
4773
4774 // Depending on cutthresholdvalue and -type we assign the ANN output into
4775 // 0 (i.e. SHID) or 1 (i.e. SPID):
4776 if (val>eIDCutTypeValue[SpecificationType]) return 1;
4777 return 1;
4778}
Double_t eIDCutTypeValue[3]
Definition: EdbShowerAlg.h:610

◆ DoRun() [1/3]

void EdbShowerAlgIDSimple::DoRun ( )
4808{
4809 if (gEDBDEBUGLEVEL >1) cout << "EdbShowerAlgIDSimple::DoRun()" << endl;
4810
4811 for (int i=0; i<eRecoShowerArrayN; i++) {
4812 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() Doing i= " << i << endl;
4813 continue;
4815
4816 //EdbShowerP* shower=(EdbShowerP*) eRecoShowerArray->At(i);
4817 EdbTrackP* shower=(EdbTrackP*) eRecoShowerArray->At(i);
4818
4819 DoRun(shower);
4820
4821 } // (int i=0; i<eRecoShowerArrayN; i++)
4822
4823 if (gEDBDEBUGLEVEL >1) cout << "EdbShowerAlgIDSimple::DoRun()...done." << endl;
4824 return;
4825}
Int_t eEnergyArrayCount
Definition: EdbShowerAlg.h:423
void DoRun()
Definition: EdbShowerAlg.cxx:4807
Definition: EdbPattern.h:113

◆ DoRun() [2/3]

void EdbShowerAlgIDSimple::DoRun ( EdbTrackP shower)

Last two variables are reserved for vtxIP and vtxDeltaZ values!!

ALSO, IF first (two) plate information shall be used... DONE IN THE WEIGHTFILE (weight of pl1&2 is then zero), so dont have to do it here...

4642{
4643
4644 if (gEDBDEBUGLEVEL>2) cout << "EdbShowerAlgIDSimple::DoRun(EdbTrackP* shower)" << endl;
4645
4646 // Get internal variables from the parametrisation filled:
4647 GetPara(shower);
4648
4649 /*
4650 int EffNr=FindClosestEfficiencyParametrization(eParaShowerAxisAngle,eEfficiencyParametrisation->Eval(eParaShowerAxisAngle));
4651
4652 // Check If Efficiency is the one we have or if we have to change/reload
4653 // the ANN weightfiles:
4654 if (GetSpecType(2)!=EffNr&&eForceSpecificationReload==kFALSE) {
4655 cout << "EdbShowerAlgIDSimple::DoRun() INFO! Calulated Efficiency is more compatible with another one: Change Specifiaction! Call SetSpecificationType(2,"<< EffNr <<")." << endl;
4656 SetSpecificationType(2,EffNr);
4657 }
4658 if (GetSpecType(2)!=EffNr&&eForceSpecificationReload==kTRUE) {
4659 cout << "EdbShowerAlgIDSimple::DoRun() INFO! Calulated Efficiency would be more compatible with another one: But eForceSpecificationReload is set to kFALSE. So we keep current Efficiency used." << endl;
4660 }
4661 */
4662
4663
4664
4665 // This is to select the suited ANN to the shower, i.e. the one that matches closest
4666 // the number of plates:
4667 int check_Npl_index =0;
4668 GetNplIndexNr(shower->Npl(),check_Npl_index,ePlateNumberType);
4669
4670
4672 ANN_MLP=ANN_MLP_ARRAY[check_Npl_index];
4673 eWeightFileString=ANN_WeightFile_ARRAY[check_Npl_index];
4674 eCalibrationOffset = eANN_MLP_CORR_0[check_Npl_index];
4675 eCalibrationSlope = eANN_MLP_CORR_1[check_Npl_index];
4676
4677 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() ANN_n_InputNeurons_ARRAY[check_Npl_index]="<< ANN_n_InputNeurons_ARRAY[check_Npl_index] << endl;
4678 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() ANN_MLP_ARRAY[check_Npl_index]="<< ANN_MLP_ARRAY[check_Npl_index] << endl;
4679 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() Using the following layout: " << endl;
4680 if (gEDBDEBUGLEVEL >2) cout << ANN_MLP->GetStructure() << endl;
4681 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() And the following weightfile: " << endl;
4682 if (gEDBDEBUGLEVEL >2) cout << eWeightFileString << endl;
4683
4684 //ANN_MLP->LoadWeights(eWeightFileString);
4685
4686 // Reset InputVariables:
4687 for (int k=0; k<70; k++) {
4688 inANN[k]=0;
4689 }
4690
4691
4692 // inANN[0] is ALWAYS Reseverd for the quantity value to be estimated
4693 // (E,Id,...)
4694 // Test with private variables:
4696 inANN[2]=eParanseg;
4701 for (int ii=0; ii<57; ii++) {
4702 inANN[7+ii]= eParalongprofile[ii];
4703 }
4705
4709
4710
4711 // Fill Tree:
4712 ANNTree->Fill();
4713 ANNTree->Show(0);
4714
4715 Double_t params[70];
4716 Double_t val;
4717
4718
4719 cout << "EdbShowerAlgIDSimple::DoRun() ------- TODO HERE: INTERFACE WITH VERTEX TO CALCULATE VTXIP AND VTXDELTAZ TO SHOWER ----------"<<endl;
4722 cout << "EdbShowerAlgIDSimple::DoRun() ------- TODO HERE: INTERFACE WITH VERTEX TO CALCULATE VTXIP AND VTXDELTAZ TO SHOWER ----------"<<endl;
4723
4724
4725
4726 for (Int_t j=1; j<=ANN_n_InputNeurons; ++j) {
4727 params[j-1]=inANN[j];
4728 }
4729
4730 for (Int_t j=1; j<=ANN_n_InputNeurons; ++j) cout << "EdbShowerAlgIDSimple::DoRun() : j params[j-1]=inANN[j] " << j<< " " << params[j-1] << endl;
4731
4732
4733 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() Print Inputvariables...done." << endl;
4734 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() Evaluate Neural Network Output:" << endl;
4735
4736 // ---------------------------------
4737 // Evaluation of the ANN:
4738 val=(ANN_MLP->Evaluate(0,params));
4739 // ---------------------------------
4740
4741 if ( ::isnan(val) ) {
4742 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() ERROR! ANN_MLP->Evaluate(0,params) is NAN! Setting value to -1. " << endl;
4743 val=-1;
4744 }
4745
4746 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() After Correction: ANN_MLP->Evaluate(0,params)= " << val << " (Inputvar=" << inANN[0] << ")." << endl;
4747
4748
4749 // Determining the type: if its SHID like or if its SPID like...
4752
4753// if (val>eANNIDCutValue) cout << "val>eANNIDCutValue" << endl;
4754//
4755// cout << "UUUUUUUUUUUUUUUUUU val= " << val << endl;
4756//
4757// shower->SetP(val);
4758//
4759// cout << "EdbShowerAlgIDSimple::DoRun() Finally, set values..." << endl;
4760// cout << "EdbShowerAlgIDSimple::DoRun() /// VERY PRELIMINARY...." << endl;
4761// cout << "EdbShowerAlgIDSimple::DoRun() Finally, set values..." << endl;
4762
4763
4764 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() ...Done." << endl;
4765 return;
4766}
Float_t eANN_MLP_CORR_0[15]
Definition: EdbShowerAlg.h:373
void GetPara(EdbTrackP *track)
Definition: EdbShowerAlg.cxx:3301
void GetNplIndexNr(Int_t sh_npl, Int_t &check_Npl_index, Int_t ePlateNumberType)
Definition: EdbShowerAlg.cxx:2993
Float_t eParaShowerAxisAngle
Definition: EdbShowerAlg.h:379
Float_t eParaBT_deltaR_mean
Definition: EdbShowerAlg.h:381
Int_t ePlateNumberType
Definition: EdbShowerAlg.h:340
Float_t eCalibrationOffset
Definition: EdbShowerAlg.h:337
Float_t eParaBT_deltaT_mean
Definition: EdbShowerAlg.h:383
Float_t eANN_MLP_CORR_1[15]
Definition: EdbShowerAlg.h:374
Float_t eCalibrationSlope
Definition: EdbShowerAlg.h:338
Int_t eParanseg
Definition: EdbShowerAlg.h:380
Float_t eParaBT_deltaT_rms
Definition: EdbShowerAlg.h:384
Float_t eParaBT_deltaR_rms
Definition: EdbShowerAlg.h:382
Int_t eParalongprofile[57]
Definition: EdbShowerAlg.h:385
TString ANN_WeightFile_ARRAY[15]
Definition: EdbShowerAlg.h:370
TString eWeightFileString
Definition: EdbShowerAlg.h:346
Int_t DetermineIDFlag(Int_t IDType)
Definition: EdbShowerAlg.cxx:4782
Int_t DetermineIDType(Double_t val, Int_t SpecificationType)
Definition: EdbShowerAlg.cxx:4770
Int_t Npl() const
Definition: EdbPattern.h:171
Int_t type
Definition: testBGReduction_By_ANN.C:15
Double_t params[3]
Definition: testBGReduction_By_ANN.C:84

◆ DoRun() [3/3]

void EdbShowerAlgIDSimple::DoRun ( TObjArray *  trackarray)
4831{
4832 if (gEDBDEBUGLEVEL >1) cout << "EdbShowerAlgIDSimple::DoRun(TObjArray* trackarray)" << endl;
4833
4834 eRecoShowerArrayN=trackarray->GetEntries();
4835 eRecoShowerArray=trackarray;
4836
4837 for (int i=0; i<eRecoShowerArrayN; i++) {
4838 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::DoRun() Doing i= " << i << endl;
4839
4841
4842 //EdbShowerP* shower=(EdbShowerP*) eRecoShowerArray->At(i);
4843 EdbTrackP* shower=(EdbTrackP*) eRecoShowerArray->At(i);
4844
4845 DoRun(shower);
4846
4847 } // (int i=0; i<eRecoShowerArrayN; i++)
4848
4849 if (gEDBDEBUGLEVEL >1) cout << "EdbShowerAlgIDSimple::DoRun(TObjArray* trackarray)...done." << endl;
4850 return;
4851}

◆ Help()

void EdbShowerAlgIDSimple::Help ( )
4270{
4271 cout << "EdbShowerAlgIDSimple::Help"<<endl;
4272 cout << "EdbShowerAlgIDSimple::Help...done"<<endl;
4273 return;
4274}

◆ Init()

void EdbShowerAlgIDSimple::Init ( void  )

This Plate Binnning is the _final_binning and will not be refined furthermore!

4459{
4461 ePlateBinning[0]=10;
4462 ePlateBinning[1]=12;
4463 ePlateBinning[2]=14;
4464 ePlateBinning[3]=16;
4465 ePlateBinning[4]=18;
4466 ePlateBinning[5]=20;
4467 ePlateBinning[6]=23;
4468 ePlateBinning[7]=26;
4469 ePlateBinning[8]=29;
4470 ePlateBinning[9]=32;
4471 ePlateBinning[10]=35;
4472 ePlateBinning[11]=40;
4473 ePlateBinning[12]=45;
4474 ePlateBinning[13]=45;
4475 ePlateBinning[14]=45; // 12,13,14 are the same, cause I have seen that it makes no sense to produce these,
4476 // since E,and sigmaE for 45 plates doesnt change anymore at all...
4477 // and how often !can! we scan more than 45 plates for a shower?
4478
4479 ePlateNumber=20; // 20 plates by default...
4480 eSpecificationType[0] = 1; // cp files by default...
4481 eSpecificationType[1] = 0; // gamma_vs_electron by default...
4482 eSpecificationType[2] = 0; // neuch eff by default...
4483 eSpecificationType[3] = 0; // SHAPEONLY by default...
4484 eSpecificationType[4] = 0; // next before weight by default...
4485 eSpecificationType[5] = 5; // 20 plates by default...
4486 eSpecificationType[6] = 0; // cutType_minDist by default...
4487
4489 eSpecificationTypeString[1]="gamma_vs_electron";
4490 eSpecificationTypeString[2]="Neuch";
4491 eSpecificationTypeString[3]="SHAPEONLY";
4492 eSpecificationTypeString[4]="Next";
4494 eSpecificationTypeString[6]="cutType_minDist";
4495
4497
4498 for (int i=0; i<15; i++) {
4500 }
4501
4502 EffFunc_all = new TF1("all","1.0-0.00000001*x",0,0.95);
4503 EffFunc_edefault = new TF1("default","0.94-0.216*x-0.767*x*x+1.865*x*x*x",0,0.95);
4504 EffFunc_elletroni = new TF1("elletroni","0.79+0.38*x-7.63*x*x+25.13*x*x*x-24.6*x*x*x*x",0,0.95);
4505 EffFunc_neuchmicro = new TF1("neuchmicro","0.94-0.955*x+1.80*x*x-0.95*x*x*x",0,0.95);
4506 EffFunc_MiddleFix = new TF1("MiddleFix","0.5*(0.888361-1.299*x+1.49198*x*x+1.64668*x*x*x-2.63758*x*x*x*x+0.79+0.38*x-7.63*x*x+25.13*x*x*x-24.6*x*x*x*x)",0,0.95);
4507 EffFunc_LowEff = new TF1("LowEff","0.85*0.5*(0.888361-1.299*x+1.49198*x*x+1.64668*x*x*x-2.63758*x*x*x*x+0.79+0.38*x-7.63*x*x+25.13*x*x*x-24.6*x*x*x*x)",0,0.95);
4508 EffFunc_UserEfficiency = new TF1("EffFunc_UserEfficiency","0.94-0.955*x+1.80*x*x-0.95*x*x*x",0,0.95); //new TSpline3();
4509
4510
4511 // Standard supposed efficiency of the showers/tracks that are to be evaluated:
4512 // The correct EffFunc_* is then choosen by taking the closes eff func to that one.
4513 // Initial parameters are the efficiency parameters for the "Neuch" parametrisation
4514 Double_t xarr[7]= {0,0.1,0.2,0.3,0.4,0.5,0.6};
4515 Double_t yarr[7]= {0.95,0.9,0.80,0.75,0.6,0.5,0.4};
4517 eEfficiencyParametrisation = new TSpline3("",xarr,yarr,5,0,0,0.65);
4518
4519 eHisto_nbtk_av = new TH1D("eHisto_nbtk_av","Average basetrack numbers",21,0.0,10.0);
4520 eHisto_longprofile_av = new TH1D("eHisto_longprofile_av","Basetracks per emulsion number",57,0.0,57.0);
4521 eHisto_transprofile_av = new TH1D("eHisto_transprofile_av","Basetracks in trans distance",8,0.0,800.0);
4522 eHisto_deltaR_mean = new TH1D("eHisto_deltaR_mean","Mean #deltar of all BTs in one shower",100,0.0,100.0);
4523 eHisto_deltaT_mean = new TH1D("eHisto_deltaT_mean","Mean #delta#theta of all BTs in one shower",100,0.0,0.1);
4524 eHisto_deltaR_rms = new TH1D("eHisto_deltaR_rms","RMS #deltar of all BTs in one shower",100,0.0,100.0);
4525 eHisto_deltaT_rms = new TH1D("eHisto_deltaT_rms","RMS #delta#theta of all BTs in one shower",100,0.0,0.1);
4526 eHisto_nbtk = new TH1D("eHisto_nbtk","Basetracks in the shower",50,0.0,100.0);
4527 eHisto_longprofile = new TH1D("eHisto_longprofile","Basetracks per emulsion number",57,0.0,57.0);
4528 eHisto_deltaR = new TH1D("eHisto_deltaR","Single #deltar of all BTs in Shower",100,0.0,150.0);
4529 eHisto_deltaT = new TH1D("eHisto_deltaT","Single #delta#theta of all BTs in Shower",150,0.0,0.15);
4530 eHisto_transprofile = new TH1D("eHisto_transprofile","Basetracks in trans distance",8,0.0,800.0);
4531
4532 // CreateANN
4533 CreateANN();
4534
4535 //First Time, we also Update()
4536 Update();
4537
4538 // Set Strings:
4539 InitStrings();
4540
4541 // Create EnergyArray
4542 eEnergyArray=new TArrayF(99999); // no way to adapt tarrayF on the fly...
4543 eEnergyArrayUnCorrected=new TArrayF(99999);
4544 eEnergyArraySigmaCorrected=new TArrayF(99999);
4545
4546 // Read ID Lookup tables:
4547 ReadTables_ID();
4548
4549 cout << "EdbShowerAlgIDSimple::Init()...done."<< endl;
4550 return;
4551}
TF1 * EffFunc_elletroni
Definition: EdbShowerAlg.h:403
Bool_t eForceSpecificationReload
Definition: EdbShowerAlg.h:354
TF1 * EffFunc_MiddleFix
Definition: EdbShowerAlg.h:405
TArrayF * eEnergyArray
Definition: EdbShowerAlg.h:415
TF1 * EffFunc_neuchmicro
Definition: EdbShowerAlg.h:404
Int_t ePlateNumber
Definition: EdbShowerAlg.h:343
TSpline3 * eEfficiencyParametrisation
Definition: EdbShowerAlg.h:412
TArrayF * eEnergyArraySigmaCorrected
Definition: EdbShowerAlg.h:417
Int_t ANN_nPlates_ARRAY[15]
Definition: EdbShowerAlg.h:366
TArrayF * eEnergyArrayUnCorrected
Definition: EdbShowerAlg.h:416
TF1 * EffFunc_UserEfficiency
Definition: EdbShowerAlg.h:407
TString eSpecificationTypeString[7]
Definition: EdbShowerAlg.h:351
TF1 * EffFunc_all
Definition: EdbShowerAlg.h:401
TF1 * EffFunc_LowEff
Definition: EdbShowerAlg.h:406
TF1 * EffFunc_edefault
Definition: EdbShowerAlg.h:402
void ReadTables_ID()
Definition: EdbShowerAlg.cxx:4243
void InitStrings()
Definition: EdbShowerAlg.cxx:4556
void Update()
Definition: EdbShowerAlg.cxx:4304
void CreateANN()
Definition: EdbShowerAlg.cxx:4591
#define NULL
Definition: nidaqmx.h:84

◆ InitStrings()

void EdbShowerAlgIDSimple::InitStrings ( )
4557{
4560
4561 eSpecificationTypeStringArray[1][0]="gamma_vs_electron";
4562 eSpecificationTypeStringArray[1][1]="electron_vs_pion";
4563 eSpecificationTypeStringArray[1][2]="pion_vs_gamma";
4564
4565 eSpecificationTypeStringArray[2][0]="Neuch";
4567 eSpecificationTypeStringArray[2][2]="MiddleFix";
4569
4570 eSpecificationTypeStringArray[3][0]="SHAPEONLY";
4571 eSpecificationTypeStringArray[3][1]="ANDVTXIP";
4572 eSpecificationTypeStringArray[3][2]="ANDVTXDELTAZ";
4573 eSpecificationTypeStringArray[3][3]="SHAPEWOPL1";
4574 eSpecificationTypeStringArray[3][4]="SHAPEWOPL12";
4575
4576 eSpecificationTypeStringArray[4][0]="Next";
4577 eSpecificationTypeStringArray[4][1]="Before";
4578
4580
4581 eSpecificationTypeStringArray[6][0]="cutType_minDist";
4582 eSpecificationTypeStringArray[6][1]="cutType_HighEff";
4583 eSpecificationTypeStringArray[6][2]="cutType_HighPur";
4584
4585 cout << "EdbShowerAlgIDSimple::InitStrings()...done."<< endl;
4586 return;
4587}
TString eSpecificationTypeStringArray[7][7]
Definition: EdbShowerAlg.h:352

◆ Print()

void EdbShowerAlgIDSimple::Print ( )
4260{
4261 cout << "EdbShowerAlgIDSimple::Print"<<endl;
4262 cout << "EdbShowerAlgIDSimple::Print...done"<<endl;
4263 return;
4264}

◆ PrintSpecifications()

void EdbShowerAlgIDSimple::PrintSpecifications ( )
4857 {
4858 cout << "EdbShowerAlgIDSimple::PrintSpecifications" << endl;
4859 cout << "EdbShowerAlgIDSimple:: eSpecificationType[0] (Dataset: (linked tracks/full cp) LT/CP) = " << GetSpecType(0) << endl;
4860 cout << "EdbShowerAlgIDSimple:: eSpecificationType[1] (ShowerID: gamma_vs_electron/electron_vs_pion/pion_vs_gamma) = " << GetSpecType(1) << endl;
4861 cout << "EdbShowerAlgIDSimple:: eSpecificationType[2] (ScanEff: Neuch/All/MiddleFix/LowEff) = " << GetSpecType(2) << endl;
4862 cout << "EdbShowerAlgIDSimple:: eSpecificationType[3] (E range: 0..20/0..40) = " << GetSpecType(3) << endl;
4863 cout << "EdbShowerAlgIDSimple:: eSpecificationType[4] (Npl weight: next before/after) = " <<GetSpecType(4) << endl;
4864 cout << "EdbShowerAlgIDSimple:: eSpecificationType[5] (Npl weight: 10,12,...,45) = " << GetSpecType(5) << endl;
4865 cout << "EdbShowerAlgIDSimple:: eSpecificationType[6] (CutType: MinDist/HighEff/HighPur) = " << GetSpecType(6) << endl;
4866 cout << "EdbShowerAlgIDSimple:: " << endl;
4867 cout << "EdbShowerAlgIDSimple:: eSpecificationTypeString[0] (take CP or linked_tracks) = " << eSpecificationTypeString[0] << endl;
4868 cout << "EdbShowerAlgIDSimple:: eSpecificationTypeString[1] (gamma_vs_electron/electron_vs_pion/pion_vs_gamma) = " << eSpecificationTypeString[1] << endl;
4869 cout << "EdbShowerAlgIDSimple:: eSpecificationTypeString[2] (ScanEff: Neuch/All/MiddleFix/LowEff) = " << eSpecificationTypeString[2] << endl;
4870 cout << "EdbShowerAlgIDSimple:: eSpecificationTypeString[3] (E range: 0..20/0..40) = " << eSpecificationTypeString[3] << endl;
4871 cout << "EdbShowerAlgIDSimple:: eSpecificationTypeString[4] (Npl weight: next before/after) = " << eSpecificationTypeString[4] << endl;
4872 cout << "EdbShowerAlgIDSimple:: eSpecificationTypeString[5] (Npl weight: 10,12,...,45) = " << eSpecificationTypeString[5] << endl;
4873 cout << "EdbShowerAlgIDSimple:: eSpecificationTypeString[6] (CutType: MinDist/HighEff/HighPur) = " << eSpecificationTypeString[6] << endl;
4874 cout << "EdbShowerAlgIDSimple:: " << endl;
4875 cout << "EdbShowerAlgIDSimple:: In case you want to change a specification then do for example:" << endl;
4876 cout << "EdbShowerAlgIDSimple:: EdbShowerAlgIDSimple->SetSpecification(2,3) " << endl;
4877 cout << "EdbShowerAlgIDSimple:: It will change the ScanEff from the actual value to _Low_." << endl;
4878 cout << "EdbShowerAlgIDSimple::" << endl;
4879 cout << "EdbShowerAlgIDSimple::PrintSpecifications...done." << endl;
4880 return;
4881}
Int_t GetSpecType(Int_t SpecificationType)
Definition: EdbShowerAlg.h:527

◆ ReadTables()

void EdbShowerAlgIDSimple::ReadTables ( )
4233{
4234 cout << "EdbShowerAlgIDSimple::ReadTables"<<endl;
4235 ReadTables_ID();
4236 cout << "EdbShowerAlgIDSimple::ReadTables...done."<<endl;
4237 return;
4238}

◆ ReadTables_ID()

void EdbShowerAlgIDSimple::ReadTables_ID ( )

First guess until tables are fully read in.

4244{
4245 cout << "EdbShowerAlgIDSimple::ReadTables_ID"<<endl;
4246
4248 cout << "First guess until tables are fully read in." << endl;
4249 eIDCutTypeValue[0]=0.5;
4250 eIDCutTypeValue[1]=0.75;
4251 eIDCutTypeValue[2]=0.25;
4252 cout << "EdbShowerAlgIDSimple::ReadTables_ID...done"<<endl;
4253 return;
4254}

◆ SetANNIDCutValue()

void EdbShowerAlgIDSimple::SetANNIDCutValue ( Double_t  ANNIDCutValue)
inline
625 {
626 eANNIDCutValue=ANNIDCutValue;
627 }
Double_t eANNIDCutValue
Definition: EdbShowerAlg.h:606

◆ SetSpecificationType()

void EdbShowerAlgIDSimple::SetSpecificationType ( Int_t  SpecificationType,
Int_t  SpecificationTypeVal 
)
4280{
4281
4282 if (gEDBDEBUGLEVEL >1) cout << "EdbShowerAlgIDSimple:: Change Specification (" << SpecificationType << ") from " << GetSpecType(SpecificationType) << " -> " << SpecificationTypeVal << " . Reprint the changed Specification String: " << endl;
4283
4284 eSpecificationType[SpecificationType]=SpecificationTypeVal;
4285 eSpecificationTypeString[SpecificationType] = eSpecificationTypeStringArray[SpecificationType][SpecificationTypeVal];
4286
4287 if (gEDBDEBUGLEVEL >1) cout << eSpecificationTypeString[SpecificationType] << endl;
4288
4291
4292 cout << "EdbShowerAlgIDSimple::SetSpecificationType eSpecificationIsChanged: " << eSpecificationIsChanged << endl;
4293 cout << "EdbShowerAlgIDSimple::SetSpecificationType eForceSpecificationReload: " << eForceSpecificationReload << endl;
4294
4295 cout << "Reprint Specifications: " << endl;
4297
4298 Update();
4299 return;
4300}
Bool_t eSpecificationIsChanged
Definition: EdbShowerAlg.h:353
void PrintSpecifications()
Definition: EdbShowerAlg.cxx:4857

◆ Update()

void EdbShowerAlgIDSimple::Update ( )
4304 {
4305 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::Update Does the following things in the order:" << endl;
4306 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::Update * According to the switch: set the right ANN of the Array as generic one." << endl;
4307 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::Update * According to the switch: load the right weightfile as generic one." << endl;
4308 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::Update * According to the switch: set the right correction parameters...." << endl;
4309
4310 TString basicstring = TString(gSystem->ExpandPathName("$FEDRA_ROOT"));
4311 TString addstring = ("/src/libShower/weights/ID/");
4312
4313 // (*) SpecType 0 :
4314 if (eSpecificationType[0]==1) {
4315 addstring+="volumeSpec_CP/";
4317 }
4318 else {
4319 addstring+="volumeSpec_LT/";
4321 cout << "EdbShowerAlgIDSimple::Update WARNING::eSpecificationTypeString[0]=LT NOT YET SUPPORTED!" << endl;
4322 }
4323
4324 // (*) SpecType 1 :
4325 // SHID_vs_SPID
4326 if (eSpecificationType[1]==2) {
4327 addstring+="separationSpec_pion_vs_gamma/";
4328 eSpecificationTypeString[1]="pion_vs_gamma";
4329 }
4330 else if (eSpecificationType[1]==1) {
4331 addstring+="separationSpec_electron_vs_pion/";
4332 eSpecificationTypeString[1]="electron_vs_pion";
4333 }
4334 else {
4335 addstring+="separationSpec_gamma_vs_electron/";
4336 eSpecificationTypeString[1]="gamma_vs_electron";
4337 }
4338
4339 // (*) SpecType 2 :
4340 if (eSpecificationType[2]==4) {
4341 addstring+="efficiencySpec_MiddleVar/";
4342 eSpecificationTypeString[2]="MiddleVar";
4343 }
4344 if (eSpecificationType[2]==3) {
4345 addstring+="efficiencySpec_LowEff/";
4346 eSpecificationTypeString[2]="LowEff";
4347 }
4348 else if (eSpecificationType[2]==2) {
4349 addstring+="efficiencySpec_MiddleFix/";
4350 eSpecificationTypeString[2]="MiddleFix";
4351 }
4352 else if (eSpecificationType[2]==1) {
4353 addstring+="efficiencySpec_All/";
4354 eSpecificationTypeString[2]="All";
4355 }
4356 else {
4357 addstring+="efficiencySpec_Neuch/";
4358 eSpecificationTypeString[2]="Neuch";
4359 }
4360
4361 // (*) SpecType 3 :
4362 // Which addiditonal variables to use....
4363// 0: showershape only
4364// 1: and vtx IP
4365// 2: and vtx delta Z
4366// 3: shoowershape only, No first plate
4367// 4: shoowershape only, No first & second plate
4368 if (eSpecificationType[3]==4) {
4369 addstring+="showerInfoSpec_SHAPEWOPL12/";
4370 eSpecificationTypeString[3]="SHAPEWOPL12";
4371 }
4372 else if (eSpecificationType[3]==3) {
4373 addstring+="showerInfoSpec_SHAPEWOPL1/";
4374 eSpecificationTypeString[3]="SHAPEWOPL1";
4375 }
4376 else if (eSpecificationType[3]==2) {
4377 addstring+="showerInfoSpec_ANDVTXDELTAZ/";
4378 eSpecificationTypeString[3]="ANDVTXDELTAZ";
4379 }
4380 else if (eSpecificationType[3]==1) {
4381 addstring+="showerInfoSpec_ANDVTXIP/";
4382 eSpecificationTypeString[3]="ANDVTXIP";
4383 }
4384 else {
4385 addstring+="showerInfoSpec_SHAPEONLY/";
4386 eSpecificationTypeString[3]="SHAPEONLY";
4387 }
4388
4389 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::Update " << addstring << endl;
4390
4391 if (NULL==ANN_MLP_ARRAY[0]) {
4392 CreateANN();
4393 }
4394
4395 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::Update Now load the different ANN weightstrings:" << endl;
4396 // This was the loading part for the ANN and
4397 // this is the loading part for the Correction Factors, which we take from the
4398 // generic file EnergyCorrections_Npl_%d.txt
4399 // For the ID class we do NOT need the correction factors, so we skip these files anyway....
4400 for (int ll=0; ll<15; ll++) {
4401 TString mkdirstring=basicstring+addstring;
4402 TString weigthstring=basicstring+addstring+TString(Form("weights_Npl_%d.txt",ANN_nPlates_ARRAY[ll]));
4403 if (gEDBDEBUGLEVEL >1) cout << "weigthstring = " << weigthstring << endl;
4404 ANN_MLP_ARRAY[ll]->LoadWeights(weigthstring);
4405 ANN_WeightFile_ARRAY[ll]=weigthstring;
4406 Float_t p0,p1;
4407 p0=0.0;
4408 p1=1.0;
4409 eANN_MLP_CORR_0[ll]=p0;
4410 eANN_MLP_CORR_1[ll]=p1;
4411 }
4412 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::Update * According to the switch: set the right ANN of the Array as generic one." << endl;
4413
4414 // (*) SpecType 4:
4415 // Get NplIndexNr:
4416 int check_Npl_index=0;
4417 GetNplIndexNr(ePlateNumber,check_Npl_index, eSpecificationType[4]);
4418
4419 if (check_Npl_index==0) eSpecificationTypeString[4]="Next";
4420 if (check_Npl_index==1) eSpecificationTypeString[4]="Before";
4421 eSpecificationTypeString[5]=TString(Form("%d",ePlateNumber));
4422
4423 // (*) SpecType 5:
4424 // HigEfficiency Cut, HighPurityCut, MinDistCut
4425 if (eSpecificationType[6]==1) {
4426 addstring+="cutType/";
4427 eSpecificationTypeString[6]="cutType_HighEff";
4428 }
4429 else if (eSpecificationType[6]==2) {
4430 addstring+="cutType/";
4431 eSpecificationTypeString[6]="cutType_HighPur";
4432 }
4433 else {
4434 addstring+="cutType/";
4435 eSpecificationTypeString[6]="cutType_minDist";
4436 }
4437
4438 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple:: The path for the ID weightfile is. " << endl;
4439 if (gEDBDEBUGLEVEL >2) cout << addstring << endl;
4440
4441
4442 // Set Generic ANN_Layout
4443 ANN_MLP=ANN_MLP_ARRAY[check_Npl_index];
4444
4445
4446 // Re-Read ID lookup tables, because of the possibility to
4447 // change the cutType threshold.
4448 ReadTables_ID();
4449
4450 if (gEDBDEBUGLEVEL >2) cout << "EdbShowerAlgIDSimple::Update WARNING:: Weightfiles for _LT_ not produced yet!...." << endl;
4451 cout << "EdbShowerAlgIDSimple::Update...done." << endl;
4452 return;
4453}

Member Data Documentation

◆ eANNIDCutValue

Double_t EdbShowerAlgIDSimple::eANNIDCutValue
protected

◆ eIDCutTypeValue

Double_t EdbShowerAlgIDSimple::eIDCutTypeValue[3]
protected

◆ eIDEnergySigmaCorr

Double_t EdbShowerAlgIDSimple::eIDEnergySigmaCorr
protected

The documentation for this class was generated from the following files: