]> git.uio.no Git - u/mrichter/AliRoot.git/blame - T0/AliT0TriggerParameters.cxx
Writing back ITS alignement data (Ruben).
[u/mrichter/AliRoot.git] / T0 / AliT0TriggerParameters.cxx
CommitLineData
0f786b96 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
30ClassImp(AliT0TriggerParameters)
31
32//________________________________________________________________
33 AliT0TriggerParameters::AliT0TriggerParameters():TObject(),
34 fSwtPmt(0),
35 fAmpCentr(5),
36 fAmpSemiCentr(1),
37 fTimeWindowLow(0),
38 fTimeWindowHigh(1)
39
40{
41 //
36cde487 42 // for (Int_t i=0; i<sizeof(fThreshold)/sizeof(*fThreshold); i++) fThreshold[i] = 0;
43 for (Int_t i=0; i<24; i++) fThreshold[i] = 0;
0f786b96 44}
45//_____________________________________________________________________________
46
47AliT0TriggerParameters::AliT0TriggerParameters(const AliT0TriggerParameters &r):
48 TObject(),
49 fSwtPmt(0),
50 fAmpCentr(5),
51 fAmpSemiCentr(1),
52 fTimeWindowLow(0),
53 fTimeWindowHigh(1)
54{
55
56 //copy constructor
57 ((AliT0TriggerParameters &) r).Copy(*this);
58
59}
60
61//_____________________________________________________________________________
62
63AliT0TriggerParameters& AliT0TriggerParameters:: operator=(const AliT0TriggerParameters &p)
64{
65 //
66 // assign. operator
67 //
68
69 if (this == &p)
70 return *this;
784e2251 71 AliT0TriggerParameters:: operator=(p);
72 fSwtPmt = p.fSwtPmt;
73 fAmpCentr = p.fAmpCentr;
74 fAmpSemiCentr = p.fAmpSemiCentr;
75 fTimeWindowLow = p.fTimeWindowLow;
76 fTimeWindowHigh = p.fTimeWindowHigh;
77 return *this;
0f786b96 78
79}
80
81//________________________________________________________________
82AliT0TriggerParameters::~AliT0TriggerParameters()
83{
84 //
85 // destrictor
86}
87//________________________________________________________________
88void AliT0TriggerParameters::Reset()
89{
90 //reset values
91
92 memset(fThreshold,0,24*sizeof(Int_t));
93
94}
95
96
97//________________________________________________________________
98void AliT0TriggerParameters::Print(Option_t*) const
99{
100 // print time values
101
102 printf("\n ---- Threshold ----\n\n");
103 printf(" Switched on/off\n");
104 for (Int_t i=0; i<24; i++) {
105 printf(" Threshold %i status %i ", fThreshold[i], GetPMTstatus(i));
106 }
107 AliInfo(Form(" Time window around vertex : %f %f",fTimeWindowLow, fTimeWindowHigh ));
108 AliInfo(Form(" Amplitude threshold: central %i semi-central %i", fAmpCentr,fAmpSemiCentr));
109
110}
111
112
113//________________________________________________________________
114void AliT0TriggerParameters::SetPMTstatus(Int_t i, Int_t val)
115{
116 if(val)fSwtPmt |= 1<<i;
117 else fSwtPmt &= ~(1<<i);
118
119}
120//________________________________________________________________
121Int_t AliT0TriggerParameters::GetPMTstatus(Int_t i) const
122{
123
124 return (1<<i)&fSwtPmt;
125
126}
127
128