AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpTriggerCrate.cxx
Go to the documentation of this file.
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$
17 // $MpId: AliMpTrigger.cxx,v 1.4 2006/05/24 13:58:52 ivana Exp $
18 
19 //-----------------------------------------------------------------------------
20 // Class AliMpTriggerCrate
21 // --------------------
22 // The class defines the properties of trigger crate
23 // Author: Ch. Finck, Subatech Nantes
24 //-----------------------------------------------------------------------------
25 
26 #include "AliMpTriggerCrate.h"
27 
28 #include "AliLog.h"
29 
30 #include <Riostream.h>
31 
32 using std::endl;
36 
37 
38 //______________________________________________________________________________
39 TString AliMpTriggerCrate::GenerateName(Int_t crateId, Int_t ddlId, Int_t nofDDLs)
40 {
42 
43  TString name;
44 
45  if (crateId < 2)
46  name = Form("%d", crateId+1);
47 
48  if (crateId == 2)
49  name = "2-3";
50 
51  if (crateId > 2)
52  name = Form("%d", crateId);
53 
54  if (crateId > 7)
55  printf("crateId index too large\n");
56 
57  if (ddlId == nofDDLs)
58  name.Append("R");
59  else
60  name.Append("L");
61 
62  return name;
63 }
64 
65 //______________________________________________________________________________
66 AliMpTriggerCrate::AliMpTriggerCrate(const Char_t* name, UShort_t id)
67  : TNamed(name, "mapping trigger crate"),
68  fId(id),
69  fDdlId(-1),
70  fLocalBoard(false)
71 
72 {
74 }
75 
76 //______________________________________________________________________________
77 AliMpTriggerCrate::AliMpTriggerCrate(TRootIOCtor* /*ioCtor*/)
78  : TNamed(),
79  fId(),
80  fDdlId(),
81  fLocalBoard()
82 {
84 }
85 
86 //______________________________________________________________________________
88 {
90 }
91 
92 //
93 // public methods
94 //
95 
96 //______________________________________________________________________________
97 Bool_t AliMpTriggerCrate::AddLocalBoard(Int_t localBoardId)
98 {
101 
102  if ( HasLocalBoard(localBoardId) ) {
103  AliWarningStream()
104  << "Local board with Id=" << localBoardId << " already present."
105  << endl;
106  return false;
107  }
108 
109  fLocalBoard.Add(localBoardId);
110  return true;
111 }
112 
113 
114 //______________________________________________________________________________
116 {
118 
119  return fLocalBoard.GetSize();
120 }
121 
122 //______________________________________________________________________________
123 Int_t AliMpTriggerCrate::GetLocalBoardId(Int_t index) const
124 {
126 
127  if (index >= 0 && index < fLocalBoard.GetSize())
128  return fLocalBoard.GetValue(index);
129  else
130  return 0; // begin at 1
131 }
132 
133 //______________________________________________________________________________
134 Bool_t AliMpTriggerCrate::HasLocalBoard(Int_t localBoardId) const
135 {
137 
138  return fLocalBoard.HasValue(localBoardId);
139 }
140 
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Int_t GetSize() const
The class defines the properties of trigger crate.
Int_t GetLocalBoardId(Int_t index) const
Bool_t HasValue(Int_t value) const
AliMpTriggerCrate()
Not implemented.
Bool_t Add(Int_t value, Bool_t warn=kTRUE)
Definition: AliMpArrayI.cxx:97
Bool_t AddLocalBoard(Int_t localBoardId)
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Int_t GetNofLocalBoards() const
AliMpArrayI fLocalBoard
local board connected to this crate
Bool_t HasLocalBoard(Int_t localBoardId) const
Int_t GetValue(Int_t index) const