Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 : * *
4 : * Author: The ALICE Off-line Project. *
5 : * Contributors are mentioned in the code where appropriate. *
6 : * *
7 : * Permission to use, copy, modify and distribute this software and its *
8 : * documentation strictly for non-commercial purposes is hereby granted *
9 : * without fee, provided that the above copyright notice appears in all *
10 : * copies and that both the copyright notice and this permission notice *
11 : * appear in the supporting documentation. The authors make no claims *
12 : * about the suitability of this software for any purpose. It is *
13 : * provided "as is" without express or implied warranty. *
14 : **************************************************************************/
15 :
16 : /* $Id: AliT0TriggerParameters.cxx 28275 2008-08-28 06:09:21Z alla $ */
17 :
18 : ///////////////////////////////////////////////////////////////////////////////
19 : // //
20 : // class for T0 calibration TM-AC-AM_6-02-2006
21 : // equalize time shift for each time CFD channel
22 : // //
23 : ///////////////////////////////////////////////////////////////////////////////
24 :
25 : #include "AliT0TriggerParameters.h"
26 : #include "AliLog.h"
27 :
28 : #include "Riostream.h"
29 :
30 20 : ClassImp(AliT0TriggerParameters)
31 :
32 : //________________________________________________________________
33 3 : AliT0TriggerParameters::AliT0TriggerParameters():TObject(),
34 3 : fSwtPmt(0),
35 3 : fAmpCentr(5),
36 3 : fAmpSemiCentr(1),
37 3 : fTimeWindowLow(0),
38 3 : fTimeWindowHigh(1)
39 :
40 15 : {
41 : //
42 : // for (Int_t i=0; i<sizeof(fThreshold)/sizeof(*fThreshold); i++) fThreshold[i] = 0;
43 150 : for (Int_t i=0; i<24; i++) fThreshold[i] = 0;
44 6 : }
45 : //_____________________________________________________________________________
46 :
47 : AliT0TriggerParameters::AliT0TriggerParameters(const AliT0TriggerParameters &r):
48 0 : TObject(),
49 0 : fSwtPmt(0),
50 0 : fAmpCentr(5),
51 0 : fAmpSemiCentr(1),
52 0 : fTimeWindowLow(0),
53 0 : fTimeWindowHigh(1)
54 0 : {
55 :
56 : //copy constructor
57 0 : ((AliT0TriggerParameters &) r).Copy(*this);
58 :
59 0 : }
60 :
61 : //_____________________________________________________________________________
62 :
63 : AliT0TriggerParameters& AliT0TriggerParameters:: operator=(const AliT0TriggerParameters &p)
64 : {
65 : //
66 : // assign. operator
67 : //
68 :
69 0 : if (this == &p)
70 0 : return *this;
71 0 : AliT0TriggerParameters:: operator=(p);
72 0 : fSwtPmt = p.fSwtPmt;
73 0 : fAmpCentr = p.fAmpCentr;
74 0 : fAmpSemiCentr = p.fAmpSemiCentr;
75 0 : fTimeWindowLow = p.fTimeWindowLow;
76 0 : fTimeWindowHigh = p.fTimeWindowHigh;
77 0 : return *this;
78 :
79 0 : }
80 :
81 : //________________________________________________________________
82 : AliT0TriggerParameters::~AliT0TriggerParameters()
83 0 : {
84 : //
85 : // destrictor
86 0 : }
87 : //________________________________________________________________
88 : void AliT0TriggerParameters::Reset()
89 : {
90 : //reset values
91 :
92 0 : memset(fThreshold,0,24*sizeof(Int_t));
93 :
94 0 : }
95 :
96 :
97 : //________________________________________________________________
98 : void AliT0TriggerParameters::Print(Option_t*) const
99 : {
100 : // print time values
101 :
102 0 : printf("\n ---- Threshold ----\n\n");
103 0 : printf(" Switched on/off\n");
104 0 : for (Int_t i=0; i<24; i++) {
105 0 : printf(" Threshold %i status %i ", fThreshold[i], GetPMTstatus(i));
106 : }
107 0 : AliInfo(Form(" Time window around vertex : %f %f",fTimeWindowLow, fTimeWindowHigh ));
108 0 : AliInfo(Form(" Amplitude threshold: central %i semi-central %i", fAmpCentr,fAmpSemiCentr));
109 :
110 0 : }
111 :
112 :
113 : //________________________________________________________________
114 : void AliT0TriggerParameters::SetPMTstatus(Int_t i, Int_t val)
115 : {
116 0 : if(val)fSwtPmt |= 1<<i;
117 0 : else fSwtPmt &= ~(1<<i);
118 :
119 0 : }
120 : //________________________________________________________________
121 : Int_t AliT0TriggerParameters::GetPMTstatus(Int_t i) const
122 : {
123 :
124 0 : return (1<<i)&fSwtPmt;
125 :
126 : }
127 :
128 :
|