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 
)
657{
658 Log(2, "ShowRec.cpp", "--- void N3_Create_ALG_MLP() ---");
659
660 if (!gROOT->GetClass("TMultiLayerPerceptron")) {
661 gSystem->Load("libMLP");
662 }
663
665 cout << "N3_ANN_Layout: " << N3_ANN_Layout.Data() << endl;
666 // Full layout would look like:
667// 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
668
669 // Create the network:
670 // Attention: for training case, the tree "simu" has already to be filled with the entries.
671 N3_TMLP_ANN = new TMultiLayerPerceptron(N3_ANN_Layout, simu, "(Entry$)%2", "(Entry$+1)%2");
672// N3_TMLP_ANN = new TMultiLayerPerceptron(N3_ANN_Layout, simu, "(Entry$)%5", "(Entry$+1)%5");
673 // This network does use the dZ to InBT (variable N3_Inputvar[0]) as primary weight
674// N3_TMLP_ANN = new TMultiLayerPerceptron(N3_ANN_Layout, "N3_Inputvar[0]", simu, "(Entry$)%2", "(Entry$+1)%2");
675 //N3_TMLP_ANN->Print();
676
677 Log(2, "ShowRec.cpp", "--- void N3_Create_ALG_MLP() done.");
678 return;
679}
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
void N3_Create_Layout()
Definition: ShowRec_Alg_N3.cpp:618
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 ( )
619{
620 // only knowlegde about number of input neurons and hidden layers needed.
621 Log(2, "ShowRec.cpp", "--- void N3_Create_Layout() ---");
622 TString layout="";
623 TString newstring="";
624
625 cout << "N3_Create_Layout() N3_ANN_INPUTNEURONS = " << N3_ANN_INPUTNEURONS << endl;
626 cout << "N3_Create_Layout() N3_ANN_NHIDDENLAYER = " << N3_ANN_NHIDDENLAYER << endl;
627
628 // ANN Input Layer
629 for (Int_t loop=0; loop<N3_ANN_INPUTNEURONS-1; ++loop) {
630 newstring=Form("@N3_Inputvar[%d],",loop);
631 //newstring=Form("N3_Inputvar[%d],",loop);
632 layout += newstring;
633 }
634 newstring=Form("@N3_Inputvar[%d]:",N3_ANN_INPUTNEURONS-1);
635 //newstring=Form("N3_Inputvar[%d]:",N3_ANN_INPUTNEURONS-1);
636 layout += newstring;
637
638 // Hidden Layers
639 for (Int_t loop=0; loop<N3_ANN_NHIDDENLAYER; ++loop) {
640 newstring=Form("%d:",N3_ANN_INPUTNEURONS);
641 layout += newstring;
642 }
643 newstring="N3_Type";
644 layout += newstring;
645
646 // cout << "N3_Create_Layout() Print layout: " << endl;
647 // cout << layout.Data() << endl;
648
649 N3_ANN_Layout = layout;
650 Log(2, "ShowRec.cpp", "--- void N3_Create_Layout() done.");
651 return;
652}
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 
)
698{
699 Log(2, "ShowRec.cpp", "--- void N3_Dump_ALG_MLP_weights() ---");
700 cout << "parasetnr = " << parasetnr << endl;
701 cout << "weightfilestring = " << Form("N3_ANN_WEIGHTS_PARASET_%d.txt",parasetnr) << endl;
702 mlp->DumpWeights(Form("N3_ANN_WEIGHTS_PARASET_%d.txt",parasetnr));
703 mlp->GetStructure();
704 mlp->Print();
705 Log(2, "ShowRec.cpp", "--- void N3_Dump_ALG_MLP_weights() done.");
706 return;
707}
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 
)
773 {
774
775 Log(4, "ShowRec.cpp", "--- void N3_FindBestCompliments() ---");
776
777 if (gEDBDEBUGLEVEL>3) {
778 cout << "Looking for best compliments for segment " << seg << " of pattern " << TestPattern << " ... " << endl;
779 cout << "Looking for pattern with Downstream = " << Downstream << endl;
780 seg->PrintNice();
781 }
782
783 EdbPattern* OtherPattern = NULL;
784 EdbPattern* OtherPatternInterim = NULL;
785
786 // Speculative calculation of delta Z value. To be refined later.
787 // See further down below.
788 // It is basically seg->Z() - OtherPattern->Z().
789 mindeltaZ = 0.0 - Downstream * 1300.0;
790
791 // Dumb workaround for the selection method, but working.
792 // Quick and dirty approach:
793 if (Downstream==0) {
794 // Will be the same plate.
795 // Take care not to compare segment with segment itself further down!!
796 OtherPattern = TestPattern;
797 }
798 else if (Downstream==1) {
799 OtherPattern = local_gAli->GetPatternSucceding(TestPattern);
800 }
801 else if (Downstream==2) {
802 OtherPatternInterim = local_gAli->GetPatternSucceding(TestPattern);
803 if (NULL==OtherPatternInterim) {
804 OtherPattern=NULL;
805 }
806 else {
807 OtherPattern = local_gAli->GetPatternSucceding(OtherPatternInterim);
808 }
809 }
810 else if (Downstream==-1) {
811 OtherPattern = local_gAli->GetPatternPreceding(TestPattern);
812 }
813 else if (Downstream==-2) {
814 OtherPatternInterim = local_gAli->GetPatternPreceding(TestPattern);
815 if (NULL==OtherPatternInterim) {
816 OtherPattern=NULL;
817 }
818 else {
819 OtherPattern = local_gAli->GetPatternPreceding(OtherPatternInterim);
820 }
821 }
822 else {
823// cout << "WARNING Downstream variable out of bounds. Return NULL as OtherPattern." << endl;
824 }
825
826 if (NULL == OtherPattern) {
827// cout << "WARNING NULL == OtherPattern. Return now." << endl;
828 return;
829 }
830
831// cout << "TestPattern has Z() of: " << TestPattern << " and next/overnext pattern has Z of: " << OtherPattern->Z() << endl;
832
833 // How many segments are there in the check_pattern?
834 Int_t nSeg = OtherPattern->N();
835// cout << "TestPattern has N entries: " << nSeg << " (one maybe the test segment)" << endl;
836 // Whats the Z difference for segment and actual pattern?
837 mindeltaZ = seg->Z() - OtherPattern->Z();
838
839 Double_t testval_dR=0;
840 Double_t testval_dT=0;
841 Double_t testval_dminDins=0;
842 Int_t IDmindR = -1;
843 Int_t IDmindT = -1;
844 Int_t IDmindminDist = -1;
845
846 // Reset minimal values to incredibly large values for first time check:
847 mindT=9999999;
848 mindR=9999999;
849 mindMinDist=9999999;
850
851 // Do finding routine now, simple comparison...
852 for (Int_t i=0; i<nSeg; ++i) {
853 EdbSegP* otherSeg = OtherPattern->GetSegment(i);
854 // dont match segment with itsself:
855 if (otherSeg==seg) continue;
856
857 // Quick Preselection: we aussume, that large away segments do not
858 // contribute to any of the minimum selection segments.
859 if (TMath::Abs(seg->X() - otherSeg->X()) > 1000 || TMath::Abs(seg->Y() - otherSeg->Y()) > 1000 ) continue;
860// cout << "seg = " << seg << " and otherSeg = " << otherSeg << endl;
861// cout << "deltaX = seg->X() - otherSeg->X() " << seg->X() - otherSeg->X() << endl;
862// cout << "deltaY = seg->Y() - otherSeg->Y() " << seg->Y() - otherSeg->Y() << endl;
863
864 // always propagate from seg to other seg (from i to j)
865 testval_dR = GetdR(seg, otherSeg);
866 testval_dT = GetdeltaThetaSingleAngles(seg, otherSeg);
867 testval_dminDins = GetdMinDist(seg, otherSeg);
868 //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 );
869 if (testval_dR < mindR ) {
870 mindR = testval_dR;
871 IDmindR = otherSeg->ID();
872 }
873 if (testval_dT < mindT ) {
874 mindT = testval_dT;
875 IDmindT = otherSeg->ID();
876 }
877 if (testval_dminDins < mindMinDist ) {
878 mindMinDist = testval_dminDins;
879 IDmindminDist = otherSeg->ID();
880 }
881 }
882
883 /*
884 cout << "Comparison for all segments gives following results: " << endl;
885 printf("IDmindR = %d, mindR = %.03f\n", IDmindR , mindR);
886 printf("IDmindT = %d, mindT = %.03f\n", IDmindT , mindT);
887 printf("IDmindminDist = %d, mindMinDist = %.03f\n", IDmindminDist , mindMinDist);
888 */
889
890 // Now check, how many different otherSeg ID() values we have...
891// cout << "Now check, how many different otherSeg ID() values we have..." << endl;
892 // Comparing ID of mindR mit mindT
893 Int_t ndifferent=3;
894 if (IDmindR==IDmindT || IDmindR==IDmindminDist || IDmindminDist==IDmindT) {
895 ndifferent=2;
896 if (IDmindR==IDmindT && IDmindR==IDmindminDist && IDmindminDist==IDmindT) ndifferent=1;
897 }
898 if (nSeg==0) ndifferent=0; // no, if no other segment was around...
899 if (nSeg==1 && OtherPattern==TestPattern) ndifferent=0; // no, if no other segment was around...
900 // Hand over new value:
901 nDifferentSegs= ndifferent;
902// cout << "nDifferentSegs contributing to min values " << nDifferentSegs << endl;
903
904 Log(4, "ShowRec.cpp", "--- void N3_FindBestCompliments() done.");
905 return;
906}
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:273
EdbPattern * GetPatternPreceding(EdbPattern *pat) const
Definition: EdbPattern.cxx:1851
EdbPattern * GetPatternSucceding(EdbPattern *pat) const
Definition: EdbPattern.cxx:1845
Definition: EdbSegP.h:21
Int_t ID() const
Definition: EdbSegP.h:147
Float_t X() const
Definition: EdbSegP.h:173
Float_t Z() const
Definition: EdbSegP.h:153
Float_t Y() const
Definition: EdbSegP.h:174
void PrintNice() const
Definition: EdbSegP.cxx:392
Float_t Z() const
Definition: EdbPattern.h:84
Int_t N() const
Definition: EdbPattern.h:86
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 
)
684{
685 Log(2, "ShowRec.cpp", "--- void N3_Load_ALG_MLP_weights() ---");
686 cout << "parasetnr = " << parasetnr << endl;
687 cout << "weightfilestring = " << Form("N3_ANN_WEIGHTS_PARASET_%d.txt",parasetnr) << endl;
688 mlp->LoadWeights(Form("N3_ANN_WEIGHTS_PARASET_%d.txt",parasetnr));
689 mlp->GetStructure();
690 mlp->Print();
691 Log(2, "ShowRec.cpp", "--- void N3_Load_ALG_MLP_weights() done.");
692 return;
693}

◆ N3_ReadOptionFile()

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

◆ ReconstructShowers_N3()

void ReconstructShowers_N3 ( )

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

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