]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDmcmSim.h
Coverity
[u/mrichter/AliRoot.git] / TRD / AliTRDmcmSim.h
index 6dd5890985dd4a0bf2b78fb2ee2d668d3b9210ec..d7cb067355233e3d6420af677e3ebc7a356c49e6 100644 (file)
@@ -46,8 +46,10 @@ class AliTRDmcmSim : public TObject {
 
           void      SetData(Int_t iadc, Int_t *adc);           // Set ADC data with array 
           void      SetData(Int_t iadc, Int_t it, Int_t adc); // Set ADC data
-         void      SetData(AliTRDarrayADC *adcArray, 
-                           AliTRDdigitsManager *digitsManager = 0x0);         // Set ADC data from adcArray
+         void      SetData(AliTRDarrayADC * const adcArray, 
+                           AliTRDdigitsManager * const digitsManager = 0x0);         // Set ADC data from adcArray
+         void      SetDataByPad(AliTRDarrayADC *const adcArray, 
+                                AliTRDdigitsManager * const digitsManager = 0x0);    // Set ADC data from adcArray
           void      SetDataPedestal(Int_t iadc);              // Fill ADC data with pedestal values
 
   static  Bool_t    GetApplyCut() { return fgApplyCut; }
@@ -70,6 +72,8 @@ class AliTRDmcmSim : public TObject {
 
          void      WriteData(AliTRDarrayADC *digits);
          Bool_t    StoreTracklets();                          // Stores tracklets via runloader
+         TString   GetTrklBranchName() { return fTrklBranchName; }
+         void      SetTrklBranchName(TString name) { fTrklBranchName = name; }
 
          Int_t     ProduceRawStream( UInt_t *buf, Int_t bufsize, UInt_t iEv = 0 ) const; // Produce raw data stream - Real data format
          Int_t     ProduceTrackletStream( UInt_t *buf, Int_t bufsize ); // produce the tracklet stream for this MCM
@@ -97,7 +101,7 @@ class AliTRDmcmSim : public TObject {
          UShort_t  FilterTailNextSample(Int_t adc, UShort_t value);
 
          // tracklet calculation
-         void      AddHitToFitreg(Int_t adc, UShort_t timebin, UShort_t qtot, Short_t ypos, Int_t label);
+         void      AddHitToFitreg(Int_t adc, UShort_t timebin, UShort_t qtot, Short_t ypos, Int_t label[]);
          void      CalcFitreg();
          void      TrackletSelection();
          void      FitTracklet();
@@ -115,6 +119,17 @@ class AliTRDmcmSim : public TObject {
   static  ostream&  Raw  (ostream &os);                       // manipulator to activate raw output
   static  ostream&  Text (ostream &os);                       // manipulator to activate text output
 
+         // PID
+         Int_t GetPID(Int_t q0, Int_t q1);
+         void PrintPidLutHuman();
+
+         // I/O
+         void PrintFitRegXml(ostream& os) const;
+         void PrintTrackletsXml(ostream& os) const;
+         void PrintAdcDatHuman(ostream& os) const;
+         void PrintAdcDatXml(ostream& os) const;
+         void PrintAdcDatDatx(ostream& os, Bool_t broadcast=kFALSE) const;
+
  protected:
          Bool_t    CheckInitialized() const;           // Check whether the class is initialized
          
@@ -146,6 +161,8 @@ class AliTRDmcmSim : public TObject {
 
          Int_t     fFitPtr[fgkNCPU];                   // pointer to the tracklet to be calculated by CPU i
 
+          TString   fTrklBranchName;                           // name of the tracklet branch to right to
+
          // Parameter classes
          AliTRDfeeParam    *fFeeParam;                 // FEE parameters
          AliTRDtrapConfig  *fTrapConfig;               // TRAP config
@@ -164,11 +181,12 @@ class AliTRDmcmSim : public TObject {
          // hit detection
          // individual hits can be stored as MC info
          struct Hit_t {                                // Array of detected hits (only available in MC)
+         Hit_t() : fChannel(0), fTimebin(0), fQtot(0), fYpos(0) { fLabel[0] = 0; fLabel[1] = 0; fLabel[2] = 0; }
            Int_t fChannel;                             // ADC channel of the hit
            Int_t fTimebin;                             // timebin of the hit
            Int_t fQtot;                                // total charge of the hit
            Int_t fYpos;                                // calculated y-position
-           Int_t fLabel;                               // label (only in MC)
+           Int_t fLabel[3];                            // up to 3 labels (only in MC)
          } fHits[fgkNHitsMC];
          Int_t fNHits;                                 // Number of detected hits
 
@@ -186,18 +204,18 @@ class AliTRDmcmSim : public TObject {
 
          // Sort functions as in TRAP
          void Sort2(UShort_t  idx1i, UShort_t  idx2i, UShort_t  val1i, UShort_t  val2i, 
-                    UShort_t *idx1o, UShort_t *idx2o, UShort_t *val1o, UShort_t *val2o) const;
+                    UShort_t * const idx1o, UShort_t * const idx2o, UShort_t * const val1o, UShort_t * const val2o) const;
          void Sort3(UShort_t  idx1i, UShort_t  idx2i, UShort_t  idx3i, 
                     UShort_t  val1i, UShort_t  val2i, UShort_t  val3i, 
-                    UShort_t *idx1o, UShort_t *idx2o, UShort_t *idx3o, 
-                    UShort_t *val1o, UShort_t *val2o, UShort_t *val3o);
+                    UShort_t * const idx1o, UShort_t * const idx2o, UShort_t * const idx3o, 
+                    UShort_t * const val1o, UShort_t * const val2o, UShort_t * const val3o);
          void Sort6To4(UShort_t  idx1i, UShort_t  idx2i, UShort_t  idx3i, UShort_t  idx4i, UShort_t  idx5i, UShort_t  idx6i, 
                        UShort_t  val1i, UShort_t  val2i, UShort_t  val3i, UShort_t  val4i, UShort_t  val5i, UShort_t  val6i, 
-                       UShort_t *idx1o, UShort_t *idx2o, UShort_t *idx3o, UShort_t *idx4o, 
-                       UShort_t *val1o, UShort_t *val2o, UShort_t *val3o, UShort_t *val4o);
+                       UShort_t * const idx1o, UShort_t * const idx2o, UShort_t * const idx3o, UShort_t * const idx4o, 
+                       UShort_t * const val1o, UShort_t * const val2o, UShort_t * const val3o, UShort_t * const val4o);
          void Sort6To2Worst(UShort_t  idx1i, UShort_t  idx2i, UShort_t  idx3i, UShort_t  idx4i, UShort_t  idx5i, UShort_t  idx6i, 
                             UShort_t  val1i, UShort_t  val2i, UShort_t  val3i, UShort_t  val4i, UShort_t  val5i, UShort_t  val6i, 
-                            UShort_t *idx5o, UShort_t *idx6o);
+                            UShort_t * const idx5o, UShort_t * const idx6o);
 
          UInt_t AddUintClipping(UInt_t a, UInt_t b, UInt_t nbits) const;  
          // Add a and b (unsigned) with clipping to the maximum value representable by nbits