FEDRA emulsion software from the OPERA Collaboration
ShowRec_Alg_N3.cpp File Reference
This graph shows which files directly or indirectly include this file:

Functions

void N3_Create_ALG_MLP (TTree *simu, Int_t parasetnr)
 
void N3_Create_Layout ()
 
void N3_Dump_ALG_MLP_weights (TMultiLayerPerceptron *mlp, Int_t parasetnr)
 
void N3_FindBestCompliments (EdbSegP *seg, EdbPattern *TestPattern, EdbPVRec *local_gAli, Int_t Downstream, Float_t &mindeltaZ, Float_t &mindT, Float_t &mindR, Float_t &mindMinDist, Int_t &nDifferentSegs)
 
void N3_Load_ALG_MLP_weights (TMultiLayerPerceptron *mlp, Int_t parasetnr)
 
void N3_ReadOptionFile ()
 
void ReconstructShowers_N3 ()
 DEBUG OPENMP TEST!!!!!!!// DEPRECATED !!!! More...
 

Function Documentation

◆ N3_Create_ALG_MLP()

void N3_Create_ALG_MLP ( TTree *  simu,
Int_t  parasetnr 
)
656 {
657  Log(2, "ShowRec.cpp", "--- void N3_Create_ALG_MLP() ---");
658 
659  if (!gROOT->GetClass("TMultiLayerPerceptron")) {
660  gSystem->Load("libMLP");
661  }
662 
664  cout << "N3_ANN_Layout: " << N3_ANN_Layout.Data() << endl;
665  // Full layout would look like:
666 // N3_ANN_Layout: N3_Inputvar[0],N3_Inputvar[1],N3_Inputvar[2],N3_Inputvar[3],N3_Inputvar[4],N3_Inputvar[5],N3_Inputvar[6],N3_Inputvar[7],N3_Inputvar[8],N3_Inputvar[9],N3_Inputvar[10],N3_Inputvar[11],N3_Inputvar[12],N3_Inputvar[13],N3_Inputvar[14],N3_Inputvar[15],N3_Inputvar[16],N3_Inputvar[17],N3_Inputvar[18],N3_Inputvar[19],N3_Inputvar[20],N3_Inputvar[21],N3_Inputvar[22],N3_Inputvar[23],N3_Inputvar[24],N3_Inputvar[25],N3_Inputvar[26],N3_Inputvar[27],N3_Inputvar[28]:29:29:29:29:29:N3_Type
667 
668  // Create the network:
669  // Attention: for training case, the tree "simu" has already to be filled with the entries.
670  N3_TMLP_ANN = new TMultiLayerPerceptron(N3_ANN_Layout, simu, "(Entry$)%2", "(Entry$+1)%2");
671 // N3_TMLP_ANN = new TMultiLayerPerceptron(N3_ANN_Layout, simu, "(Entry$)%5", "(Entry$+1)%5");
672  // This network does use the dZ to InBT (variable N3_Inputvar[0]) as primary weight
673 // N3_TMLP_ANN = new TMultiLayerPerceptron(N3_ANN_Layout, "N3_Inputvar[0]", simu, "(Entry$)%2", "(Entry$+1)%2");
674  //N3_TMLP_ANN->Print();
675 
676  Log(2, "ShowRec.cpp", "--- void N3_Create_ALG_MLP() done.");
677  return;
678 }
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
void N3_Create_Layout()
Definition: ShowRec_Alg_N3.cpp:617
TMultiLayerPerceptron * N3_TMLP_ANN
Definition: ShowRec_Alg_N3.h:5
TString N3_ANN_Layout
Definition: ShowRec_Alg_N3.h:14
TTree * simu
Definition: testBGReduction_By_ANN.C:12

◆ N3_Create_Layout()

void N3_Create_Layout ( )
618 {
619  // only knowlegde about number of input neurons and hidden layers needed.
620  Log(2, "ShowRec.cpp", "--- void N3_Create_Layout() ---");
621  TString layout="";
622  TString newstring="";
623 
624  cout << "N3_Create_Layout() N3_ANN_INPUTNEURONS = " << N3_ANN_INPUTNEURONS << endl;
625  cout << "N3_Create_Layout() N3_ANN_NHIDDENLAYER = " << N3_ANN_NHIDDENLAYER << endl;
626 
627  // ANN Input Layer
628  for (Int_t loop=0; loop<N3_ANN_INPUTNEURONS-1; ++loop) {
629  newstring=Form("@N3_Inputvar[%d],",loop);
630  //newstring=Form("N3_Inputvar[%d],",loop);
631  layout += newstring;
632  }
633  newstring=Form("@N3_Inputvar[%d]:",N3_ANN_INPUTNEURONS-1);
634  //newstring=Form("N3_Inputvar[%d]:",N3_ANN_INPUTNEURONS-1);
635  layout += newstring;
636 
637  // Hidden Layers
638  for (Int_t loop=0; loop<N3_ANN_NHIDDENLAYER; ++loop) {
639  newstring=Form("%d:",N3_ANN_INPUTNEURONS);
640  layout += newstring;
641  }
642  newstring="N3_Type";
643  layout += newstring;
644 
645  // cout << "N3_Create_Layout() Print layout: " << endl;
646  // cout << layout.Data() << endl;
647 
648  N3_ANN_Layout = layout;
649  Log(2, "ShowRec.cpp", "--- void N3_Create_Layout() done.");
650  return;
651 }
Int_t N3_ANN_NHIDDENLAYER
Definition: ShowRec_Alg_N3.h:23
Int_t N3_ANN_INPUTNEURONS
Definition: ShowRec_Alg_N3.h:29

◆ N3_Dump_ALG_MLP_weights()

void N3_Dump_ALG_MLP_weights ( TMultiLayerPerceptron *  mlp,
Int_t  parasetnr 
)
697 {
698  Log(2, "ShowRec.cpp", "--- void N3_Dump_ALG_MLP_weights() ---");
699  cout << "parasetnr = " << parasetnr << endl;
700  cout << "weightfilestring = " << Form("N3_ANN_WEIGHTS_PARASET_%d.txt",parasetnr) << endl;
701  mlp->DumpWeights(Form("N3_ANN_WEIGHTS_PARASET_%d.txt",parasetnr));
702  mlp->GetStructure();
703  mlp->Print();
704  Log(2, "ShowRec.cpp", "--- void N3_Dump_ALG_MLP_weights() done.");
705  return;
706 }
TMultiLayerPerceptron * mlp
Definition: testBGReduction_By_ANN.C:61

◆ N3_FindBestCompliments()

void N3_FindBestCompliments ( EdbSegP seg,
EdbPattern TestPattern,
EdbPVRec local_gAli,
Int_t  Downstream,
Float_t &  mindeltaZ,
Float_t &  mindT,
Float_t &  mindR,
Float_t &  mindMinDist,
Int_t &  nDifferentSegs 
)
772  {
773 
774  Log(4, "ShowRec.cpp", "--- void N3_FindBestCompliments() ---");
775 
776  if (gEDBDEBUGLEVEL>3) {
777  cout << "Looking for best compliments for segment " << seg << " of pattern " << TestPattern << " ... " << endl;
778  cout << "Looking for pattern with Downstream = " << Downstream << endl;
779  seg->PrintNice();
780  }
781 
782  EdbPattern* OtherPattern = NULL;
783  EdbPattern* OtherPatternInterim = NULL;
784 
785  // Speculative calculation of delta Z value. To be refined later.
786  // See further down below.
787  // It is basically seg->Z() - OtherPattern->Z().
788  mindeltaZ = 0.0 - Downstream * 1300.0;
789 
790  // Dumb workaround for the selection method, but working.
791  // Quick and dirty approach:
792  if (Downstream==0) {
793  // Will be the same plate.
794  // Take care not to compare segment with segment itself further down!!
795  OtherPattern = TestPattern;
796  }
797  else if (Downstream==1) {
798  OtherPattern = local_gAli->GetPatternSucceding(TestPattern);
799  }
800  else if (Downstream==2) {
801  OtherPatternInterim = local_gAli->GetPatternSucceding(TestPattern);
802  if (NULL==OtherPatternInterim) {
803  OtherPattern=NULL;
804  }
805  else {
806  OtherPattern = local_gAli->GetPatternSucceding(OtherPatternInterim);
807  }
808  }
809  else if (Downstream==-1) {
810  OtherPattern = local_gAli->GetPatternPreceding(TestPattern);
811  }
812  else if (Downstream==-2) {
813  OtherPatternInterim = local_gAli->GetPatternPreceding(TestPattern);
814  if (NULL==OtherPatternInterim) {
815  OtherPattern=NULL;
816  }
817  else {
818  OtherPattern = local_gAli->GetPatternPreceding(OtherPatternInterim);
819  }
820  }
821  else {
822 // cout << "WARNING Downstream variable out of bounds. Return NULL as OtherPattern." << endl;
823  }
824 
825  if (NULL == OtherPattern) {
826 // cout << "WARNING NULL == OtherPattern. Return now." << endl;
827  return;
828  }
829 
830 // cout << "TestPattern has Z() of: " << TestPattern << " and next/overnext pattern has Z of: " << OtherPattern->Z() << endl;
831 
832  // How many segments are there in the check_pattern?
833  Int_t nSeg = OtherPattern->N();
834 // cout << "TestPattern has N entries: " << nSeg << " (one maybe the test segment)" << endl;
835  // Whats the Z difference for segment and actual pattern?
836  mindeltaZ = seg->Z() - OtherPattern->Z();
837 
838  Double_t testval_dR=0;
839  Double_t testval_dT=0;
840  Double_t testval_dminDins=0;
841  Int_t IDmindR = -1;
842  Int_t IDmindT = -1;
843  Int_t IDmindminDist = -1;
844 
845  // Reset minimal values to incredibly large values for first time check:
846  mindT=9999999;
847  mindR=9999999;
848  mindMinDist=9999999;
849 
850  // Do finding routine now, simple comparison...
851  for (Int_t i=0; i<nSeg; ++i) {
852  EdbSegP* otherSeg = OtherPattern->GetSegment(i);
853  // dont match segment with itsself:
854  if (otherSeg==seg) continue;
855 
856  // Quick Preselection: we aussume, that large away segments do not
857  // contribute to any of the minimum selection segments.
858  if (TMath::Abs(seg->X() - otherSeg->X()) > 1000 || TMath::Abs(seg->Y() - otherSeg->Y()) > 1000 ) continue;
859 // cout << "seg = " << seg << " and otherSeg = " << otherSeg << endl;
860 // cout << "deltaX = seg->X() - otherSeg->X() " << seg->X() - otherSeg->X() << endl;
861 // cout << "deltaY = seg->Y() - otherSeg->Y() " << seg->Y() - otherSeg->Y() << endl;
862 
863  // always propagate from seg to other seg (from i to j)
864  testval_dR = GetdR(seg, otherSeg);
865  testval_dT = GetdeltaThetaSingleAngles(seg, otherSeg);
866  testval_dminDins = GetdMinDist(seg, otherSeg);
867  //printf("i otherSeg->ID() testval_dR testval_dT testval_dminDins %d, %d, %.03f %.03f %.03f \n",i,otherSeg->ID(), testval_dR ,testval_dT ,testval_dminDins );
868  if (testval_dR < mindR ) {
869  mindR = testval_dR;
870  IDmindR = otherSeg->ID();
871  }
872  if (testval_dT < mindT ) {
873  mindT = testval_dT;
874  IDmindT = otherSeg->ID();
875  }
876  if (testval_dminDins < mindMinDist ) {
877  mindMinDist = testval_dminDins;
878  IDmindminDist = otherSeg->ID();
879  }
880  }
881 
882  /*
883  cout << "Comparison for all segments gives following results: " << endl;
884  printf("IDmindR = %d, mindR = %.03f\n", IDmindR , mindR);
885  printf("IDmindT = %d, mindT = %.03f\n", IDmindT , mindT);
886  printf("IDmindminDist = %d, mindMinDist = %.03f\n", IDmindminDist , mindMinDist);
887  */
888 
889  // Now check, how many different otherSeg ID() values we have...
890 // cout << "Now check, how many different otherSeg ID() values we have..." << endl;
891  // Comparing ID of mindR mit mindT
892  Int_t ndifferent=3;
893  if (IDmindR==IDmindT || IDmindR==IDmindminDist || IDmindminDist==IDmindT) {
894  ndifferent=2;
895  if (IDmindR==IDmindT && IDmindR==IDmindminDist && IDmindminDist==IDmindT) ndifferent=1;
896  }
897  if (nSeg==0) ndifferent=0; // no, if no other segment was around...
898  if (nSeg==1 && OtherPattern==TestPattern) ndifferent=0; // no, if no other segment was around...
899  // Hand over new value:
900  nDifferentSegs= ndifferent;
901 // cout << "nDifferentSegs contributing to min values " << nDifferentSegs << endl;
902 
903  Log(4, "ShowRec.cpp", "--- void N3_FindBestCompliments() done.");
904  return;
905 }
Double_t GetdeltaThetaSingleAngles(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.cpp:7258
Double_t GetdMinDist(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.h:170
Double_t GetdR(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.h:167
Definition: EdbPattern.h:280
EdbPattern * GetPatternPreceding(EdbPattern *pat) const
Definition: EdbPattern.cxx:2017
EdbPattern * GetPatternSucceding(EdbPattern *pat) const
Definition: EdbPattern.cxx:2011
Definition: EdbSegP.h:18
Int_t ID() const
Definition: EdbSegP.h:144
Float_t X() const
Definition: EdbSegP.h:170
Float_t Z() const
Definition: EdbSegP.h:150
Float_t Y() const
Definition: EdbSegP.h:171
void PrintNice() const
Definition: EdbSegP.cxx:418
Float_t Z() const
Definition: EdbPattern.h:87
Int_t N() const
Definition: EdbPattern.h:89
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66
gEDBDEBUGLEVEL
Definition: energy.C:7
#define NULL
Definition: nidaqmx.h:84

◆ N3_Load_ALG_MLP_weights()

void N3_Load_ALG_MLP_weights ( TMultiLayerPerceptron *  mlp,
Int_t  parasetnr 
)
683 {
684  Log(2, "ShowRec.cpp", "--- void N3_Load_ALG_MLP_weights() ---");
685  cout << "parasetnr = " << parasetnr << endl;
686  cout << "weightfilestring = " << Form("N3_ANN_WEIGHTS_PARASET_%d.txt",parasetnr) << endl;
687  mlp->LoadWeights(Form("N3_ANN_WEIGHTS_PARASET_%d.txt",parasetnr));
688  mlp->GetStructure();
689  mlp->Print();
690  Log(2, "ShowRec.cpp", "--- void N3_Load_ALG_MLP_weights() done.");
691  return;
692 }

◆ N3_ReadOptionFile()

void N3_ReadOptionFile ( )
712 {
713  Log(2, "ShowRec.cpp", "--- void N3_ReadOptionFile() ---");
714  cout << "Read OptionFile N3_Options.txt (no change of name possible currently)" << endl;
715 
716  // read parameters from par-file
717  // return: 0 if ok
718  // -1 if file access failed
719  char buf[256];
720  char key[256];
721  char name[256];
722  const char *file="N3_Options.txt";
723 
724  FILE *fp = fopen(file,"r");
725  if (!fp) {
726  Log(1,"N3_ReadOptionFile","ERROR open file: %s", file);
727  return;
728  }
729  else Log(2,"N3_ReadOptionFile","Read shower parameters from file: %s", file );
730 
731  Int_t id;
732  Int_t int_eUse;
733  int dospec;
734  TString tmpString;
735  char tmpchar[256];
736 
737  while (fgets(buf, sizeof(buf), fp)) {
738  for (Int_t i = 0; i < (Int_t)strlen(buf); ++i)
739  if (buf[i]=='#') {
740  buf[i]='\0'; // cut out comments starting from #
741  break;
742  }
743 
744  if ( sscanf(buf,"%s",key)!=1 ) continue;
745 
746  if ( !strcmp(key,"N3_TRAIN") )
747  {
748  int train;
749  sscanf(buf+strlen(key),"%d",&train);
750  cout << "N3_ReadOptionFile train = " << train << endl;
751  N3_DoTrain=train;
752  }
753  else if ( !strcmp(key,"N3_TRAIN_NMAX") )
754  {
755  int trainNMax;
756  sscanf(buf+strlen(key),"%d",&trainNMax);
757  cout << "N3_ReadOptionFile trainNMax = " << trainNMax << endl;
758  N3_TrainNMax=trainNMax;
759  }
760 
761  } // end of while (fgets(buf, sizeof(buf), fp)) loop
762  fclose(fp);
763 
764 
765  Log(2, "ShowRec.cpp", "--- void N3_ReadOptionFile() done.");
766  return;
767 }
Int_t N3_TrainNMax
Definition: ShowRec_Alg_N3.h:16
Bool_t N3_DoTrain
Definition: ShowRec_Alg_N3.h:6
fclose(pFile)
const char * name
Definition: merge_Energy_SytematicSources_Electron.C:24
UInt_t id
Definition: tlg2pattern.C:118
TFile * file
Definition: write_pvr.C:3

◆ ReconstructShowers_N3()

void ReconstructShowers_N3 ( )

DEBUG OPENMP TEST!!!!!!!// DEPRECATED !!!!

3 {
4  Log(2, "ShowRec.cpp", "--- void ReconstructShowers_N3() ---");
5 
6  //-----------------------------------------------------------------
7  // Main function for reconstruction of N3 Algorithm
8  //-----------------------------------------------------------------
9 
10  //-----------------------------------
11  // For each InitiatorBT this is
12  // divided in several small parts:
13  //
14  // 1) Make local_gAli with cut parameters, Make GetPID of InBT and corresponding of plates
15  // 3) Loop over (whole) local_gAli, check BT for Cuts
16  // 4) Calculate pur/eff/NBT numbers
17  // 5) Fill Trees
18  //-----------------------------------
19 
20  // Read options for easy set up N3_Algorithm structures
21  // N3_ReadOptionFile(); // not implemented yet. will maybe not be done anymore
22 
23  // Option for quick switching training/running mode of the ANN
24  cout << " cmd_ALN3TRAIN = " << cmd_ALN3TRAIN << endl;
25  if (cmd_ALN3TRAIN==1) {
26  N3_DoTrain = kTRUE;
27  }
28  else {
29  N3_DoTrain = kFALSE;
30  }
31 
32 
33 
34  // Create the root file first, otherwise the trees are not connected with the
35  // specified file...
36  TFile* N3_ALG_ANN_TrainingsFile;
37  if (cmd_ALN3TRAIN==1) {
38  N3_ALG_ANN_TrainingsFile = new TFile(Form("N3_ALG_ANN_TrainingsFile_PARASET_%d.root",GLOBAL_PARASETNR),"RECREATE");
39  }
40 
41 
42  // Variables and things important for neural Network:
43  TTree *simu = new TTree("TreeSignalBackgroundBT", "TreeSignalBackgroundBT");
44  simu->Branch("N3_Type", &N3_Type, "N3_Type/I");
45  simu->Branch("N3_Inputvar", N3_Inputvar, "N3_Inputvar[24]/D");
46  //------------------------------
47  // Attention: the cloned tree has not the same values after filling.
48  // Is it possible that the Clone() function somehow destroys the tree branches
49  // and their addresses??? That means, dont use the method here:
50  // TTree *simu_SG = (TTree *)simu->Clone();
51  // Try creating the trees in the "uncloned" way!
52  // Yes, it seems to be like that. With this method,
53  // the trees _SG and _BG are filled with the normal values.
54  TTree *simu_SG = new TTree("TreeSignalBT", "TreeSignalBT");
55  simu_SG->Branch("N3_Type", &N3_Type, "N3_Type/I");
56  simu_SG->Branch("N3_Inputvar", N3_Inputvar, "N3_Inputvar[24]/D");
57  TTree *simu_BG = new TTree("TreeBackgroundBT", "TreeBackgroundBT");
58  simu_BG->Branch("N3_Type", &N3_Type, "N3_Type/I");
59  simu_BG->Branch("N3_Inputvar", N3_Inputvar, "N3_Inputvar[24]/D");
60  // Reminder: be aware, that the Variables for TTrees only exist in this
61  // local function ReconstructShowers_N3()and not outside it.
62  //------------------------------
63 
64 
65  // If "running" (i.e. not training) mode, then the neural network is
66  // created at the beginning of the reconstruction routine.
67  if (N3_DoTrain!=kTRUE) {
70  }
71 
72 
73  // Define Helper Variables:
74  EdbPVRec* local_gAli;
75  EdbSegP* InBT;
76  EdbSegP* seg;
77  Float_t local_gAli_pat_interim_halfsize=0;
78 
81 
82  //-----------------------------------------------------------------
83  // Since GLOBAL_InBTArray is filled in ascending ordering by zpositon
84  // We use the descending loop to begin with BT with lowest z first.
85  for (Int_t i=GLOBAL_InBTArrayEntries-1; i>=0; --i) {
86 
87  //-----------------------------------
88  // CounterOutPut
89  if (gEDBDEBUGLEVEL==2) if ((i%1)==0) cout << GLOBAL_InBTArrayEntries <<" InBT in total, still to do:"<<Form("%4d",i)<< "\r\r\r\r"<<flush;
90  //-----------------------------------
91 
92  //-----------------------------------
93  // Get InitiatorBT from GLOBAL_InBTArray
94  InBT=(EdbSegP*)GLOBAL_InBTArray->At(i);
95  //--------
96  GLOBAL_InBT_E=InBT->P();
97  //GLOBAL_InBT_TanTheta=TMath::Sqrt(InBT->TX()*InBT->TX()+InBT->TY()*InBT->TY());
98  GLOBAL_InBT_TanTheta=InBT->Theta(); // same value as above.
99  GLOBAL_InBT_Flag=InBT->Flag();
100  GLOBAL_InBT_MC=InBT->MCEvt();
101  //--------
102  Int_t local_NBT=0;
103  Int_t local_NBTMC=0;
104  Int_t local_NBTallMC=0;
105  Int_t local_NBTeMC=0;
106  float_t local_pure=-1;
107  float_t local_purall=-1;
108  Int_t npat_int=0;
109  Int_t npat_total=0;
110  Int_t npatN=0;
111  Int_t npat_Neff=0;
112  Int_t NBT_Neff=0;
113  Int_t NBTMC_Neff=0;
114  Int_t NBTMCe_Neff=0;
115  //--------
116 
117  if (gEDBDEBUGLEVEL>2) {
118  cout << endl << endl << "--- Starting Shower for Number " << i << " now: "<<endl;
119  InBT->PrintNice();
120  }
121  //-----------------------------------
122 
123  //-----------------------------------
124  // 1) Make local_gAli with cut parameters:
125  //-----------------------------------
126  local_gAli = TransformEdbPVRec(GLOBAL_gAli, InBT);
127  // Add InBT to GLOBAL_ShowerSegArray
128  GLOBAL_ShowerSegArray -> Add(InBT);
129  //-----------------------------------
130 
131  // Clone InBT, because it is modified a lot of times,
132  // avoid rounding errors by propagating back and forth
133  EdbSegP* InBTClone = (EdbSegP*)InBT->Clone();
134 
135 
136  //-----------------------------------
137  // 1a) Reset characteristic variables:
138  //-----------------------------------
139  for (Int_t loop=0; loop<24; ++loop) N3_Inputvar[loop]=0;
140  Int_t NaddedSGToTrainTree=0;
141  Int_t NaddedBGToTrainTree=0;
142 
143 
144  //-----------------------------------
145  // 2) Loop over (whole) local_gAli, check BT for Cuts
146  //-----------------------------------
147  Int_t local_gAli_npat=local_gAli->Npatterns();
148  //cout << "--- local_gAli_npat= " << local_gAli_npat << endl;
149  if (gEDBDEBUGLEVEL>2) cout << "--- local_gAli_npat= " << local_gAli_npat << endl;
150 
151  // Loop over all plates of local_gAli, since this is already
152  // extracted with the right numbers of plates...
153  for (Int_t patterloop_cnt=local_gAli_npat-1; patterloop_cnt>=0; --patterloop_cnt) {
154  if (gEDBDEBUGLEVEL>3) cout << "--- --- Doing patterloop_cnt= " << patterloop_cnt << endl;
155 
156  // Needed to have StepX,Y,TX,TY bins set for the FindCompliments Function.
157  //EdbPattern* ActualPattern = (EdbPattern*)local_gAli->GetPattern(patterloop_cnt);
158  //ActualPattern -> FillCell(20,20,0.01,0.01);
159 
160  EdbPattern* TestPattern= (EdbPattern*)local_gAli->GetPattern(patterloop_cnt);
161  Int_t btloop_cnt_N=TestPattern->GetN();
162 
163  for (Int_t btloop_cnt=0; btloop_cnt<btloop_cnt_N; ++btloop_cnt) {
164  seg = (EdbSegP*)local_gAli->GetPattern(patterloop_cnt)->GetSegment(btloop_cnt);
165  if (gEDBDEBUGLEVEL>3) seg->PrintNice();
166 
167  //cout << "Doing segment " << btloop_cnt << " of " << btloop_cnt_N << " now: " << endl;
168  //seg->PrintNice();
169 
170  // Now calculate NN Histogram Inputvariables:
171  N3_Type = 0; // Track is "Background"
172  if (seg->MCEvt()>0) N3_Type = 1; // Track is "Signal"
173 
174  // Calculate the first four inputvariables, which depend on InitiatorBT only:
175  // Important: dR, dMindist is symmetric, dR is NOT!
176  // Do propagation from InBT to seg! (i.e. to downstream segments)
177  // Loose PreCuts, in order not to get too much BG BT into trainings sample
178  N3_Inputvar[0] = seg->Z()-InBT->Z();
179  // Update: It is better to use DistToAxis instead of dR, since dR measures
180  // only distance to InBT without taking care of the direction.
181  // (does not matter for relatively straight tracks, but for tracks in direction)
182  // N3_Inputvar[1] = GetdR(InBT, seg);
183  N3_Inputvar[1] = GetDistToAxis(InBTClone, seg);
184  // Why was this cut only for DoTrain put in? this is also valid
185  // for running, is it not ???
186  if (N3_Inputvar[1] > 1000) continue;
187  // if (N3_DoTrain==kTRUE && N3_Inputvar[1] > 1000) continue;
188 
189  N3_Inputvar[2] = GetdeltaThetaSingleAngles(InBT, seg);
190  if (N3_Inputvar[2] > 0.4) continue;
191  // if (N3_DoTrain==kTRUE && N3_Inputvar[2] > 0.4) continue;
192 
193  N3_Inputvar[3] = GetdMinDist(InBT, seg);
194  if (N3_Inputvar[3] > 1000) continue;
195  // if (N3_DoTrain==kTRUE && N3_Inputvar[3] > 1000) continue;
196 
197 
198 
199  // Originally, I tried here a routine to use the
200  // "FindCompliments"-Function of EdbPattern.
201  // Unfortunately the sigma of the X,Y,TX,TY is somehow very
202  // small and then it returns only one compatible segment,
203  // the segment itself.
204  // So I choose another method: I find the best value for one
205  // segment in the dR, dT, dMinDist space.
206  // If a segment is connected to this one, then these values
207  // should belong to same segment.
208  // If a segment is only BG, the best dR, dT, dMinDist compatible
209  // segments are different, so the number of different segments
210  // to give the best value should be 0 for a SG basetrack and
211  // 3 for a BG basetrack.
212 
213  Float_t mindeltaZ=0;
214  Float_t mindT=0;
215  Float_t mindR=0;
216  Float_t mindMinDist=0;
217  Int_t nDifferentSegs=-1;
218  Int_t OffsetNVar=4;
219  // Order: same plate, one plate upstream, one plate downstream,
220  // two plates upstream, two plates downstream
221  // This order is important, dont mix it anymore!!
222  Int_t deltaNpl[5]= {0,-1,1,-2,2};
223  Int_t dNpl=0;
224  //max arraynumber: deltaNpl[N3_ANN_PLATE_DELTANMAX]
225  // therefore, loop only over those who are actually needed for the calculation!
226  for (Int_t loop_deltaNpl = 0; loop_deltaNpl<5; ++loop_deltaNpl) {
227  N3_Inputvar[OffsetNVar+0] = 0;
228  N3_Inputvar[OffsetNVar+1] = 0;
229  N3_Inputvar[OffsetNVar+2] = 0;
230  N3_Inputvar[OffsetNVar+3] = 0;
231  OffsetNVar+=4;
232  }
233 
234  // Start with OffsetNVar=4 for array position seg-related.
235  OffsetNVar=4;
236  // Loop just over the different plates necessary:
237  for (Int_t loop_deltaNpl = 0; loop_deltaNpl<N3_ANN_PLATE_DELTANMAX; ++loop_deltaNpl) {
238 // for (Int_t loop_deltaNpl = 0; loop_deltaNpl<5; ++loop_deltaNpl) {
239  dNpl=deltaNpl[loop_deltaNpl];
240  mindT=0;
241  mindR=0;
242  mindMinDist=0;
243  nDifferentSegs=-1;
244  // This function may be time comsuming ...
245  // No approach to make it faster available yet ...
246 
247  N3_FindBestCompliments( seg, TestPattern, local_gAli, dNpl, mindeltaZ, mindT, mindR, mindMinDist, nDifferentSegs );
248 
249 
250  // mindeltaZ;// no effect, take it out...
251  N3_Inputvar[OffsetNVar+0] = mindR;
252  N3_Inputvar[OffsetNVar+1] = mindT;
253  N3_Inputvar[OffsetNVar+2] = mindMinDist;
254  N3_Inputvar[OffsetNVar+3] = nDifferentSegs;
255  OffsetNVar+=4;
256  }
257 
258  // TO HAVE AROUND SAME SG AND BG Events, TAKE ABOUT EVERY 100TH BG
259  // BG_BASETRACK ONLY (otherwise too much BG Tracks, too long training time)
260  // dont cut. .... Better do it in the default.par cut instead of here...
261  // But no! It needs the full BG-density. So better here!
262  // if (N3_DoTrain==kTRUE && N3_Type ==0 && gRandom->Uniform()*1000>10) continue;
263  // if (N3_DoTrain==kTRUE && N3_Type ==0 && gRandom->Uniform()*1000>500) continue;
264  // maybe not good after all ....
265 
266  if (gEDBDEBUGLEVEL>3) {
267  cout << "*******************************************************************"<<endl;
268  cout << "Print out all variables for BT i ___ connected with InBT : *****"<<endl;
269  OffsetNVar=0;
270  printf("BT i->ID(), Type, dZ, dR, dT, dMinDist: %07d %d %.03f %.03f %.03f %.03f\n",seg->ID(),N3_Type, N3_Inputvar[OffsetNVar+0], N3_Inputvar[OffsetNVar+1], N3_Inputvar[OffsetNVar+2], N3_Inputvar[OffsetNVar+3]);
271  OffsetNVar=4;
272  cout << "Print out all variables for BT i NOT connected with InBT : *****"<<endl;
273  for (Int_t loop_deltaNpl = 0; loop_deltaNpl<5; ++loop_deltaNpl) {
274  dNpl=deltaNpl[loop_deltaNpl];
275  printf("BT i->ID(), Type, dNpl, mindR, mindT, mindMinDist nDifferentSegs, : %07d %d %.03f %.03f %.03f %.03f %d \n",seg->ID(),N3_Type, dNpl, N3_Inputvar[OffsetNVar+0], N3_Inputvar[OffsetNVar+1], N3_Inputvar[OffsetNVar+2], N3_Inputvar[OffsetNVar+3]);
276  OffsetNVar+=4;
277  }
278  cout << "*******************************************************************"<<endl;
279  }
280 
281 
282 // cout << "*******************************************************************"<<endl;
283 
284 
285  // Now fill NN SG/BG Trees with the Inputvariables: --------------------
286  // Only in Case of Training:
287  if (N3_DoTrain==kTRUE) {
288  if ( N3_Type == 1 ) {
289  simu->Fill();
290  simu_SG->Fill();
291  NaddedSGToTrainTree++;
292  }
293  else {
294  // if this state is enabled, then BG-tracks will only be added in a
295  // proportion that the number is equal to SG-tracks
296  Double_t currentBGSGRatio= Double_t (NaddedBGToTrainTree)/(1+Double_t(NaddedSGToTrainTree));
297  Double_t currentBGTotalRatio= Double_t (NaddedBGToTrainTree)/(1+Double_t(NaddedSGToTrainTree+NaddedBGToTrainTree));
298 
299  //cout << "NaddedSGToTrainTree NaddedBGToTrainTree currentBGTotalRatio "<< endl;
300  //cout << NaddedSGToTrainTree << " " << NaddedBGToTrainTree << " " << currentBGTotalRatio << endl;
301 
302  Bool_t addBGTrack=kFALSE;
303  Double_t UniformTestNumber=gRandom->Uniform();
304 
305  //cout << "UniformTestNumber = " << UniformTestNumber << endl;
306  //cout << "currentBGTotalRatio = " << currentBGTotalRatio << endl;
307 
308  if ( UniformTestNumber > currentBGTotalRatio) addBGTrack=kTRUE;
309  if (N3_ANN_EQUALIZESGBG==0) addBGTrack=kTRUE;
310 
311 
312  //cout << "Do we add this (BG-)track info in the simu-tree?" << addBGTrack << endl;
313  if (addBGTrack) {
314  simu->Fill();
315  simu_BG->Fill();
316  NaddedBGToTrainTree++;
317  }
318  }
319 
320  } // end of if (N3_DoTrain==kTRUE); fill NN SG/BG Trees with the Inputvariables
321  else {
322  N3_OutputValue=0;
323  // Adapt: array params should have as many entries as there are inputvariables.
324  //N3_OutputValue =TMlpANN->Evaluate(0, N3_Inputvar);
325 // cout << " Evaluated value.... STILL to BE ADAPTED!!! "<< N3_OutputValue <<endl;
326 
327  // This array is larger than possible used array for evaluation.
328  // The array with the right size is created, when the N3_ANN_INPUTNEURONS
329  // variable is fixed (TMLP class demands #arraysize = #inputneurons)
330  // This is a kind of dump workaround, but for now it should work.
331 // cout << "N3_ANN_INPUTNEURONS = " << N3_ANN_INPUTNEURONS << endl;
332  Double_t EvalValue=0;
333  Double_t N3_Evalvar4[4];
334  Double_t N3_Evalvar8[8];
335  Double_t N3_Evalvar12[12];
336  Double_t N3_Evalvar16[16];
337  Double_t N3_Evalvar20[20];
338  Double_t N3_Evalvar24[24];
339 
340  if (N3_ANN_INPUTNEURONS==4) {
341  for (int k=0; k<N3_ANN_INPUTNEURONS; ++k) N3_Evalvar4[k]= N3_Inputvar[k];
342  EvalValue=N3_TMLP_ANN->Evaluate(0,N3_Evalvar4);
343  }
344  else if (N3_ANN_INPUTNEURONS==8) {
345  for (int k=0; k<N3_ANN_INPUTNEURONS; ++k) N3_Evalvar8[k]= N3_Inputvar[k];
346  EvalValue=N3_TMLP_ANN->Evaluate(0,N3_Evalvar8);
347  }
348  else if (N3_ANN_INPUTNEURONS==12) {
349  for (int k=0; k<N3_ANN_INPUTNEURONS; ++k) N3_Evalvar12[k]= N3_Inputvar[k];
350  EvalValue=N3_TMLP_ANN->Evaluate(0,N3_Evalvar12);
351  }
352  else if (N3_ANN_INPUTNEURONS== 16) {
353  for (int k=0; k<N3_ANN_INPUTNEURONS; ++k) N3_Evalvar16[k]= N3_Inputvar[k];
354  EvalValue=N3_TMLP_ANN->Evaluate(0,N3_Evalvar16);
355  }
356  else if (N3_ANN_INPUTNEURONS==20) {
357  for (int k=0; k<N3_ANN_INPUTNEURONS; ++k) N3_Evalvar20[k]= N3_Inputvar[k];
358  EvalValue=N3_TMLP_ANN->Evaluate(0,N3_Evalvar20);
359  }
360  else {
361  for (int k=0; k<N3_ANN_INPUTNEURONS; ++k) N3_Evalvar24[k]= N3_Inputvar[k];
362  EvalValue=N3_TMLP_ANN->Evaluate(0,N3_Evalvar24);
363  }
364 
365 
366  // Set Output value:
367  N3_OutputValue = EvalValue;
368  //-------------------------------------------
369 
370 
371  /*
372  Bool_t DebugCHECKMATCH=kTRUE;
373  // cout << "DEBUG-------------------------------------------------- " << endl;
374  // cout << "DEBUG N3_ANN_INPUTNEURONS= " << N3_ANN_INPUTNEURONS << endl;
375  // DEBUG CHECK OUTPUT: checked track is SG, and the evalutation output is wrong:
376  if( InBT->MCEvt()==seg->MCEvt() ) {
377  if (N3_OutputValue>CUT_PARAMETER[4]) {
378  // cout << "Checked Value is good!" << endl;
379  }
380  else {
381  cout << "Checked Value is wrong!" << endl;
382  DebugCHECKMATCH=kFALSE;
383  }
384  }
385  else {
386  if (N3_OutputValue<CUT_PARAMETER[4]) {
387  // cout << "Checked Value is good!" << endl;
388  }
389  else {
390  cout << "Checked Value is wrong!" << endl;
391  DebugCHECKMATCH=kFALSE;
392  }
393  }
394 
395  if (DebugCHECKMATCH==kFALSE) {
396  cout << "DEBUG-------------------------------------------------- " << endl;
397  cout << "!!! This output value does not mach the MC-Truth information. Print Segments:" << endl;
398  cout << "Print InBT and to be checked segment:" << endl;
399  InBT->PrintNice();
400  seg->PrintNice();
401  cout << "EvalValue=Evaluate(0,N3_Evalvar[N3_ANN_INPUTNEURONS]) = " << EvalValue << endl;
402  cout << "DEBUG-------------------------------------------------- " << endl;
403  }
404  */
405 
406 
407 
408  /*
409  cout << "DEBUG N3_ANN_INPUTNEURONS= " << N3_ANN_INPUTNEURONS << endl;
410  cout << "N3_Inputvar [0]= " << N3_Inputvar[0] << endl;
411  cout << "N3_Evalvar24[N3_ANN_INPUTNEURONS-1]= " << N3_Evalvar24[N3_ANN_INPUTNEURONS-1] << endl;
412  cout << "Print InBT and to be checked segment:" << endl;
413  InBT->PrintNice();
414  seg->PrintNice();
415  cout << "EvalValue=Evaluate(0,N3_Evalvar[N3_ANN_INPUTNEURONS]) = " << EvalValue << endl;
416  cout << "------------------------------" << endl;
417  */
418 
419 
420 
422  /*
423  if (N3_OutputValue>CUT_PARAMETER[4]) {
424  cout << "CUT_PARAMETER[4]=" << CUT_PARAMETER[4] << endl;
425  cout << "N3_OutputValue=" << N3_OutputValue << endl;
426  cout << "Add segment to GLOBAL_ShowerSegArray!: print segment once again: " << endl;
427  seg->PrintNice();
428  }
429  */
430 
431  } // end of if (N3_DoTrain==kTRUE) else
432 
433 
434 
435 
436  // Now apply cut conditions: NEW NEURAL NETWORK Alg --------------------
437  // CUT_PARAMETER[4] is N3_ANN_OUTPUTTHRESHOLD
438  if (N3_OutputValue<CUT_PARAMETER[4]) continue;
439  // end of cut conditions: NEW NEURAL NETWORK Alg --------------------
440 // cout << "N3_OutputValue=" << N3_OutputValue << endl;
441 
442  // If we arrive here, Basetrack seg has passed criteria
443  // and is then added to the shower array:
444  // Check if its not the InBT which is already added:
445  if (seg->X()==InBT->X()&&seg->Y()==InBT->Y()) {
446  //cout << "TODO REWRITE IF CONDITION USING EDBSEG METHODS!!!!!"<< endl;
447  ; // do nothing;
448  }
449  else {
450 // cout << "add segment to GLOBAL_ShowerSegArray! " << endl;
451 // seg->PrintNice();
452  GLOBAL_ShowerSegArray -> Add(seg);
453  }
454  }
455 
456  // Calc BT density around shower:
457  EdbPattern* pat_interim=local_gAli->GetPattern(patterloop_cnt);
458  CalcTrackDensity(pat_interim,local_gAli_pat_interim_halfsize,npat_int,npat_total,npatN);
459 
460  // Calc TrackNumbers for plate for efficency numbers:
461  CalcEfficencyNumbers(pat_interim, InBT->MCEvt(), NBT_Neff, NBTMC_Neff,NBTMCe_Neff);
462  }
463  // end of loop over all plates of local_gAli
465 
466 // cout << "--- NaddedSGToTrainTree= " << NaddedSGToTrainTree << endl;
467 // cout << "--- NaddedBGToTrainTree= " << NaddedBGToTrainTree << endl;
468 
469 
470  // Delete the cloned, now unneccessary object, otherwise memory overload:
471  delete InBTClone;
472 
473  //-----------------------------------
474  // 4) Calculate pur/eff/NBT numbers,
475  // not needed when only reconstruction
476  // done:
477  //-----------------------------------
478  if (cmd_OUTPUTLEVEL>=2 || cmd_OUTPUTLEVEL==0) {
479  Int_t NBT=0;
480  Int_t NBTMC=0;
481  Int_t NBTallMC=0;
482  Int_t NBTeMC=0;
483  Double_t eff, purall, pure;
484  CalcEffPurOfShower2(GLOBAL_ShowerSegArray, NBT, NBTMC, NBTallMC, NBTeMC, purall, pure, NBT_Neff, NBTMC_Neff,NBTMCe_Neff);
485 
486  // Fill only for MC Event:
487  if (GLOBAL_InBT_MC>0) {
492  }
494  }
495 
496  //-----------------------------------
497  // 5) Fill Tree:
498  //-----------------------------------
499  TREE_ShowRecEff->Fill();
500  if (gEDBDEBUGLEVEL>3) TREE_ShowRecEff->Show(TREE_ShowRecEff->GetEntries()-1);
501 
502 
503  //-----------------------------------
504  // 6a) Transfer ShowerArray to treebranchTreeEntry:
505  //-----------------------------------
506  if (cmd_OUTPUTLEVEL>0) {
508  }
509 
510 
511  //------------------------------------
512  // Reset and delete important things:
513  // also to avoid memory problems ...
514  //-----------------------------------
515  GLOBAL_ShowerSegArray->Clear();
516  if (gEDBDEBUGLEVEL>3) cout << "--- ---GLOBAL_ShowerSegArray->GetEntries(): "<< GLOBAL_ShowerSegArray->GetEntries() << endl;
517  delete local_gAli;
518  local_gAli=0;
520  //------------------------------------
521  }
522  // end of loop over GLOBAL_InBTArrayEntries
523  //-----------------------------------------------------------------
524 
525  if (gEDBDEBUGLEVEL==2) cout << endl<<flush;
526  if (gEDBDEBUGLEVEL>3) cout << "---TREE_ShowRecEff->GetEntries() ... " << TREE_ShowRecEff->GetEntries() << endl;
527  if (gEDBDEBUGLEVEL>3) cout << "---GLOBAL_INBTSHOWERNR ... " << GLOBAL_INBTSHOWERNR<< endl;
528 
529 
530 
531 
532 
533 
534  // SPECIAL ROUTINE FOR N3 ALG: Only in Case of Training:
535  if (N3_DoTrain==kTRUE) {
536  cout << " Now write NN SG/BG Trees with the Inputvariables: --------------------"<<endl;
537  simu_SG->Print();
538  simu_BG->Print();
539  simu->Print();
540  cout << " Now show first entry of SG/BG Trees with the Inputvariables: --------------------"<<endl;
541  cout << " Signal Tree: --------------------"<<endl;
542  simu_SG->Show(0);
543  cout << " Background Tree: --------------------"<<endl;
544  simu_BG->Show(0);
545  simu->Show(0);
546  cout << "--------------------"<<endl;
547  // Create and Get the right TMLP for the right parameterset:
548  // simu has to be filled first, thats the reason why the mlp is created here and not before.
550  cout << "void ReconstructShowers_N3() N3_TMLP_ANN->GetStructure() " << N3_TMLP_ANN->GetStructure() << endl;
551 // cout << "return now ............" << endl;
552 // return;
553 
554 
555 
556  cout << " ------------------------------------------------------------" << endl;
557  cout << " NOW TRAIN THE NETWORK .... " << endl;
558  N3_TMLP_ANN->Train(N3_ANN_NTRAINEPOCHS, "text,update=1");
559  cout << " NOW TRAIN THE NETWORK .... done." << endl;
560  cout << " Dump Weights into the file .... " << endl;
561  N3_TMLP_ANN->DumpWeights("weights.txt");
563  cout << " Dump Weights into the file done. " << endl;
564 
565  // Use TMLPAnalyzer to see what it looks for
566  cout << " Use TMLPAnalyzer to see what it looks for " << endl;
567  TCanvas* mlpa_canvas = new TCanvas("mlpa_canvas","Network analysis");
568  mlpa_canvas->Divide(3,1);
569  TMLPAnalyzer* ana = new TMLPAnalyzer(N3_TMLP_ANN);
570  // Initialisation
571  ana->GatherInformations();
572  // output to the console
573  ana->CheckNetwork();
574  mlpa_canvas->cd(1);
575  // shows how each variable influences the network
576  ana->DrawDInputs();
577  mlpa_canvas->cd(2);
578  // shows the network structure
579  N3_TMLP_ANN->Draw();
580  mlpa_canvas->cd(3);
581  // draws the resulting network
582  ana->DrawNetwork(0,"N3_Type==1","N3_Type==0");
583  mlpa_canvas->cd();
584 
585  cout << " Use TMLPAnalyzer to see what it looks for... done." << endl;
586  cout << " ------------------------------------------------------------" << endl;
587  cout << " NOW WRITE FILES to THE ROOT FILES .... " << endl;
588 
589  simu->Write();
590 
591  if (cmd_ALN3DUMP ==1 ) {
592  // write trees also in the root file.
593  // Attention: can give large root files!
594  simu_SG->Write();
595  simu_BG->Write();
596  N3_TMLP_ANN->Write();
597  ana->Write();
598  mlpa_canvas->Write();
599  }
600 
601  N3_ALG_ANN_TrainingsFile->Close();
602  cout << " NOW WRITE FILES to THE ROOT FILES .... done. " << endl;
603 
604  } // Train==TRUE
605 
606  Log(2, "ShowRec.cpp", "--- void ReconstructShowers_N3() done.");
607  return;
608 }
void N3_Dump_ALG_MLP_weights(TMultiLayerPerceptron *mlp, Int_t parasetnr)
Definition: ShowRec_Alg_N3.cpp:696
void N3_FindBestCompliments(EdbSegP *seg, EdbPattern *TestPattern, EdbPVRec *local_gAli, Int_t Downstream, Float_t &mindeltaZ, Float_t &mindT, Float_t &mindR, Float_t &mindMinDist, Int_t &nDifferentSegs)
Definition: ShowRec_Alg_N3.cpp:772
void N3_Create_ALG_MLP(TTree *simu, Int_t parasetnr)
Definition: ShowRec_Alg_N3.cpp:655
void N3_Load_ALG_MLP_weights(TMultiLayerPerceptron *mlp, Int_t parasetnr)
Definition: ShowRec_Alg_N3.cpp:682
Double_t N3_OutputValue
Definition: ShowRec_Alg_N3.h:15
Int_t N3_Type
Definition: ShowRec_Alg_N3.h:12
Double_t N3_ANN_OUTPUTTHRESHOLD
Definition: ShowRec_Alg_N3.h:24
Int_t N3_ANN_EQUALIZESGBG
Definition: ShowRec_Alg_N3.h:25
Int_t N3_ANN_PLATE_DELTANMAX
Definition: ShowRec_Alg_N3.h:20
Double_t N3_Inputvar[24]
Definition: ShowRec_Alg_N3.h:8
Int_t N3_ANN_NTRAINEPOCHS
Definition: ShowRec_Alg_N3.h:22
void CalcTrackDensity(EdbPattern *pat_interim, Float_t pat_interim_halfsize, Int_t &npat_int, Int_t &npat_total, Int_t &npatN)
Definition: ShowRec.cpp:8749
void TransferShowerObjectArrayIntoEntryOfTreebranchShowerTree(TTree *treebranchtree, TObjArray *segarray)
Definition: ShowRec.cpp:7940
EdbPVRec * TransformEdbPVRec(EdbPVRec *gAli, EdbSegP *InitiatorBT)
DEBUG OPENMP TEST!!!!!!!
Definition: ShowRec.cpp:6299
void CalcEffPurOfShower2(TObjArray *arr, Int_t &NBT, Int_t &NBTMC, Int_t &NBTallMC, Int_t &NBTeMC, Double_t &purall, Double_t &pure, Int_t NBT_Neff, Int_t NBTMC_Neff, Int_t NBTMCe_Neff)
Definition: ShowRec.cpp:7631
void PrintShowerObjectArray(TObjArray *segarray)
Definition: ShowRec.cpp:6967
void CalcEfficencyNumbers(EdbPattern *pat_interim, Int_t MCCheck, Int_t &NBT_Neff, Int_t &NBTMC_Neff, Int_t &NBTMCe_Neff)
Definition: ShowRec.cpp:8771
Int_t GLOBAL_INBTSHOWERNR
Definition: ShowRec.h:80
Double_t GLOBAL_trckdens
Definition: ShowRec.h:39
EdbPVRec * GLOBAL_gAli
Definition: ShowRec.h:73
Int_t cmd_OUTPUTLEVEL
Definition: ShowRec.h:33
Int_t GLOBAL_PARASETNR
Definition: ShowRec.h:79
Int_t GLOBAL_EvtBT_FlagArray[99999]
Definition: ShowRec.h:51
TObjArray * GLOBAL_ShowerSegArray
Definition: ShowRec.h:76
Int_t GLOBAL_InBT_MC
Definition: ShowRec.h:43
Double_t GLOBAL_EvtBT_EArray[99999]
Definition: ShowRec.h:52
Int_t GLOBAL_EvtBT_MCArray[99999]
Definition: ShowRec.h:51
TTree * TREE_ShowRecEff
Definition: ShowRec.h:62
Float_t shower_trackdensb
Definition: ShowRec.h:395
Int_t GLOBAL_InBT_Flag
Definition: ShowRec.h:43
Double_t GLOBAL_EvtBT_E
Definition: ShowRec.h:50
Double_t GLOBAL_InBT_TanTheta
Definition: ShowRec.h:44
Double_t GLOBAL_InBT_E
Definition: ShowRec.h:44
Double_t CUT_PARAMETER[10]
Definition: ShowRec.h:78
Int_t GLOBAL_EvtBT_MC
Definition: ShowRec.h:49
Int_t GLOBAL_InBTArrayEntries
Definition: ShowRec.h:75
Double_t GLOBAL_EvtBT_TanThetaArray[99999]
Definition: ShowRec.h:52
Double_t GLOBAL_EvtBT_TanTheta
Definition: ShowRec.h:50
TTree * TREE_ShowShower
Definition: ShowRec.h:68
Int_t GLOBAL_EvtBT_Flag
Definition: ShowRec.h:49
TObjArray * GLOBAL_InBTArray
Definition: ShowRec.h:74
Definition: EdbPVRec.h:148
Int_t Npatterns() const
Definition: EdbPattern.h:380
EdbPattern * GetPattern(int id) const
Definition: EdbPattern.cxx:1887
Float_t P() const
Definition: EdbSegP.h:149
Float_t Theta() const
Definition: EdbSegP.h:181
Int_t MCEvt() const
Definition: EdbSegP.h:142
Int_t Flag() const
Definition: EdbSegP.h:146
Int_t GetN() const
Definition: EdbPattern.h:65
Int_t cmd_ALN3DUMP
Definition: ShowRec.h:34
Double_t GetDistToAxis(EdbSegP *segAxis, EdbSegP *segTest)
Definition: ShowRecCalculatingFunctions.cpp:185
Int_t cmd_ALN3TRAIN
Definition: ShowRec.h:33
new TCanvas()
TCanvas * mlpa_canvas
Definition: testBGReduction_By_ANN.C:66
TMLPAnalyzer ana(mlp)