-
Notifications
You must be signed in to change notification settings - Fork 1
/
DkWinTimeCut.C
69 lines (52 loc) · 1.84 KB
/
DkWinTimeCut.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// Anthony Hillairet, April 2008
///
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Includes here
class DkWinTimeCut : public ModuleClass{
public :
DkWinTimeCut() {};
~DkWinTimeCut() {};
bool Init(EventClass &E, HistogramFactory &H, ConfigFile &Conf, log4cpp::Category *TmpLog) ;
bool Process(EventClass &E, HistogramFactory &H);
private :
log4cpp::Category *Log;
string Name;
double DkWinTimeMin;
double DkWinTimeMax;
};
bool DkWinTimeCut::Init(EventClass &E, HistogramFactory &H, ConfigFile &Conf, log4cpp::Category *TmpLog)
{
Log = TmpLog;
Log->info( "Register DkWinTime Cut");
// -------- Name of the cut --------- //
Name = "DkWinTime";
// --------- Special list of cut in this class for the global histograms --------- //
H.AddCut(Name);
if (not Conf.read<bool>("DkWinTimeCut/Do"))
{
Log->info( "DkWinTime Cut turned OFF");
return false;
}
// --------- Histograms initialization --------- //
H.DefineTH1D( "DkWinTimeCut", "DkWinTime_before", "Decay window time before the cut",4*160, -6000.,10000.);
H.DefineTH1D( "DkWinTimeCut", "DkWinTime_after", "Decay window time after the cut", 4*160, -6000.,10000.);
// --------- Parameters initialization --------- //
DkWinTimeMin = Conf.read<double>("DkWinTimeCut/Min");
DkWinTimeMax = Conf.read<double>("DkWinTimeCut/Max");
return true;
}
bool DkWinTimeCut::Process(EventClass &E, HistogramFactory &H)
{
// ____ ____ //
H.NbCandidateTracks(Name,E);
H.Fill("DkWinTime_before",E.win_time[E.iewin]);
if( not ( E.win_time[E.iewin] > DkWinTimeMin and E.win_time[E.iewin] < DkWinTimeMax ))
{
H.CutApplied(Name);
return false;
}
H.Fill("DkWinTime_after",E.win_time[E.iewin]);
return true;
}