AliRoot Core  edcc906 (edcc906)
CheckRaw.C
Go to the documentation of this file.
1 //____________________________________________________________________
2 //
3 // $Id$
4 //
5 // Script that contains a class to compare the raw data written to the
6 // digits it's created from.
7 //
8 // Use the script `Compile.C' to compile this class using ACLic.
9 //
10 #include <AliLog.h>
11 #include <AliFMDDigit.h>
12 #include <AliFMDInput.h>
13 #include <AliFMDUShortMap.h>
14 #include <AliFMDParameters.h>
15 #include <iostream>
16 #include <TStyle.h>
17 #include <TArrayF.h>
18 #include <TCanvas.h>
19 
30 class CheckRaw : public AliFMDInput
31 {
32 public:
34  {
36  AddLoad(kRaw);
37  }
38  Bool_t Init()
39  {
40  Bool_t ret = AliFMDInput::Init();
41  // AliFMDGeometry* geom = AliFMDGeometry::Instance();
42  // geom->Init();
43  // geom->InitTransformations();
45  param->Init();
46  return ret;
47  }
48  Bool_t ProcessDigit(AliFMDDigit* digit)
49  {
50  // Cache the energy loss
51  if (!digit) return kFALSE;
52  UShort_t det = digit->Detector();
53  Char_t rng = digit->Ring();
54  UShort_t sec = digit->Sector();
55  UShort_t str = digit->Strip();
56  if (str > 511) {
57  AliWarning(Form("Bad strip number %d in digit", str));
58  return kTRUE;
59  }
60  fMap(det, rng, sec, str) = digit->Counts();
61  return kTRUE;
62  }
64  {
65  // Cache the energy loss
66  if (!digit) return kFALSE;
67  UShort_t det = digit->Detector();
68  Char_t rng = digit->Ring();
69  UShort_t sec = digit->Sector();
70  UShort_t str = digit->Strip();
71  if (str > 511) {
72  AliWarning(Form("Bad strip number %d in digit", str));
73  return kTRUE;
74  }
75  if (digit->Counts() != fMap(det, rng, sec, str) &&
76  fMap(det, rng, sec, str) != 1024) {
77  AliWarning(Form("Mismatch in digit FMD%d%c[%2d,%3d] %d != %d",
78  det, rng, sec, str, digit->Counts(),
79  fMap(det, rng, sec, str)));
80  return kTRUE;
81  }
82  AliDebug(1, Form("Raw digit FMD%d%c[%2d,%3D] is good",
83  det, rng, sec, str));
84  return kTRUE;
85  }
86 protected:
88 };
89 
90 
91 //____________________________________________________________________
92 //
93 // EOF
94 //
95 
96 
97 
98 
class for digits
Definition: AliFMDDigit.h:28
Map of an integer per strip.
Digits for the FMD.
FMD utility classes for reading FMD data.
UShort_t Sector() const
Char_t Ring() const
This class is a singleton that handles various parameters of the FMD detectors. This class reads from...
Manager of FMD parameters.
Per strip of unisgned shorts (16 bit) data.
#define AliWarning(message)
Definition: AliLog.h:541
Bool_t Init()
Definition: CheckRaw.C:38
virtual Bool_t Init()
UShort_t Strip() const
virtual void AddLoad(ETrees tree)
Definition: AliFMDInput.h:134
static AliFMDParameters * Instance()
CheckRaw()
Definition: CheckRaw.C:33
Bool_t ProcessDigit(AliFMDDigit *digit)
Definition: CheckRaw.C:48
Bool_t ProcessRawDigit(AliFMDDigit *digit)
Definition: CheckRaw.C:63
Base class for reading in various FMD data. The class loops over all found events. For each event the specified data is read in. The class then loops over all elements of the read data, and process these with user defined code.
Definition: AliFMDInput.h:106
#define AliDebug(logLevel, message)
Definition: AliLog.h:300
Check raw I/O.
Definition: CheckRaw.C:30
AliFMDUShortMap fMap
Definition: CheckRaw.C:87
UShort_t Detector() const
UShort_t Counts() const
Definition: AliFMDDigit.h:147
UShort_t Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll)