~indra-vamos/kaliveda/kaliveda_e503

« back to all changes in this revision

Viewing changes to FAZIA/factory/KVFAZIASelectorTemplate.cpp

  • Committer: Peter Wigg
  • Date: 2015-07-01 12:51:53 UTC
  • Revision ID: peter.wigg.314159@gmail.com-20150701125153-3qr211dcu3fc0y5t
Merge with kaliveda-dev (FAZIA directory only).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// This class is derived from the KaliVeda class KVFAZIASelector.
 
2
// The following members functions are called by the TTree::Process() functions:
 
3
//    InitRun():       called everytime a run starts
 
4
//    EndRun():        called everytime a run ends
 
5
//    InitAnalysis():  called at the beginning of the analysis
 
6
//                     a convenient place to create your histograms.
 
7
//    Analysis():      called for each event. In this function you 
 
8
//                     fill your histograms.
 
9
//    EndAnalysis():   called at the end of a loop on the tree,
 
10
//                     a convenient place to draw/fit your histograms.
 
11
//
 
12
// Modify these methods as you wish in order to create your analysis class.
 
13
// Don't forget that for every class used in the analysis, you must put a
 
14
// line '#include' at the beginning of this file.
 
15
// E.g. if you want to access informations on the FAZIA multidetector
 
16
// through the global pointer gIndra, you must AT LEAST add the line
 
17
//   #include "KVFAZIA.h"
 
18
 
 
19
void KVFAZIASelectorTemplate::InitAnalysis(void)
 
20
 {
 
21
 // 
 
22
 // Declaration of histograms, global variables, etc.
 
23
 // Called at the beginning of the analysis
 
24
 //
 
25
 
 
26
 //
 
27
 // Enter your code here
 
28
 //
 
29
 // To access some information about FAZIA, use the global pointer gFazia
 
30
 // e.g. to access the list of silicon detetors
 
31
 //             KVList *list = gFazia->GetListOfDetectors();
 
32
 //
 
33
 //When running in batch mode, the global pointer gBatchSystem gives access
 
34
 //to the batch system running the analysis. You can use this to name files
 
35
 //according to the jobname, for example:
 
36
 //
 
37
 //   TFile *my_file;
 
38
 //   if( gBatchSystem )  // running in batch
 
39
 //      my_file = new TFile( Form("%s.root", gBatchSystem->GetJobName()), "create");
 
40
 //   else  // interactive
 
41
 //      my_file = new TFile( "KVFAZIASelectorTemplate.root", "create");
 
42
 }
 
43
 
 
44
//_____________________________________
 
45
void KVFAZIASelectorTemplate::InitRun(void)
 
46
 {
 
47
 // 
 
48
 // Initialisations for each run
 
49
 // Called at the beginning of each run
 
50
 //
 
51
 
 
52
 //
 
53
 // Enter your code here
 
54
 //
 
55
 //
 
56
 // If you want the angles of particles to be calculated using the
 
57
 // centre of each detector (instead of the randomised angles used by default):
 
58
 //     GetEvent()->UseMeanAngles();
 
59
 //
 
60
 //The run number of the currently analysed run is given by
 
61
 //   gFazia->GetCurrentRunNumber();
 
62
 
 
63
 }
 
64
 
 
65
//_____________________________________
 
66
Bool_t KVFAZIASelectorTemplate::Analysis(void)
 
67
 {
 
68
 // 
 
69
 // Analysis method.
 
70
 // The event pointer can be retrieved by a call to GetEvent().
 
71
 // See KVReconstructedEvent documentation for the available methods.
 
72
 //
 
73
 // In order to loop over all correctly identified particles in the event
 
74
 // (assuming the corresponding code masks were set in InitRun):
 
75
 //             KVReconstructedNucleus* particle;
 
76
 //             while ( (particle = (KVReconstructedNucleus* )GetEvent()->GetNextParticle("ok")) ){
 
77
 //            int z = particle->GetZ();
 
78
 //            ...etc. etc.
 
79
 //     }
 
80
 
 
81
 //
 
82
 // Enter your code here
 
83
 //
 
84
 
 
85
 return kTRUE;
 
86
 }
 
87
 
 
88
//_____________________________________
 
89
void KVFAZIASelectorTemplate::EndRun(void)
 
90
 {
 
91
 // 
 
92
 // Called at the end of each run
 
93
 //
 
94
 
 
95
 //
 
96
 // Enter your code here
 
97
 //
 
98
 
 
99
 }
 
100
 
 
101
//_____________________________________
 
102
void KVFAZIASelectorTemplate::EndAnalysis(void)
 
103
 {
 
104
 // 
 
105
 // Global calculations, saving of histograms in files
 
106
 // Called at the end of the analysis
 
107
 //
 
108
 
 
109
 //
 
110
 // Enter your code here
 
111
 //
 
112
 
 
113
 }