Int_t bufsize = 16000;
fTreeR->Branch("PMDRecpoint", &fRecpoints, bufsize);
-
- Int_t irownew = 0;
- Int_t icolnew = 0;
- Int_t irownew1 = 0;
- Int_t icolnew1 = 0;
const Int_t kDet = 2;
const Int_t kSMN = 24;
const Int_t kRow = 48;
// << " row = " << row << " col = " << col
// << " sig = " << sig << endl;
- // Transform all the (0,0) coordinates to the geant frame
- if(smn < 6)
- {
- irownew1 = 95 - row;
- icolnew1 = col;
- }
- else if(smn >= 6 && smn < 12)
- {
- irownew1 = row;
- icolnew1 = 47 - col;
- }
- else if(smn >= 12 && smn < 18)
- {
- irownew1 = 47 - row;
- icolnew1 = col;
- }
- else if(smn >= 18 && smn < 24)
- {
- irownew1 = row;
- icolnew1 = 95 - col;
- }
-
- // for smn < 12 : row = 96, column = 48
- // for smn>= 12 and < 24 : row = 48, column = 96
- // In order to make it uniform dimension, smn < 12 are inverted
- // i.i., row becomes column and column becomes row
- // for others it remains same
- // This is further inverted back while calculating eta and phi
- if(smn < 12)
- {
- // SupeModule 1 and 2 : Rows are inverted to columns and vice versa
- // and at the time of calculating the eta,phi it is again reverted
- // back
- irownew = icolnew1;
- icolnew = irownew1;
- }
- else if( smn >= 12 && smn < 24)
- {
- irownew = irownew1;
- icolnew = icolnew1;
- }
-
if (det == 0)
{
- preADC[smn][irownew][icolnew] = sig;
+ preADC[smn][row][col] = sig;
}
else if (det == 1)
{
- cpvADC[smn][irownew][icolnew] = sig;
+ cpvADC[smn][row][col] = sig;
}
} // while loop
Int_t ddlno, Int_t & totword,
UInt_t *buffer)
{
-
+ // Retrives digits data UnitModule by UnitModule
UInt_t baseword;
-
UInt_t mcmno, chno;
UInt_t adc;
- Int_t irownew = 0;
- Int_t icolnew = 0;
- Int_t irownew1 = 0;
- Int_t icolnew1 = 0;
Int_t det, smn, irow, icol;
-
treeD->GetEntry(imodule);
Int_t nentries = fDigits->GetLast();
totword = nentries+1;
icol = fPMDdigit->GetColumn();
adc = (UInt_t) fPMDdigit->GetADC();
- // cout << " imodule = " << imodule << " smn = " << smn << endl;
-
- if(smn < 12)
- {
- irownew1 = icol;
- icolnew1 = irow;
- }
- else if( smn >= 12 && smn < 24)
- {
- irownew1 = irow;
- icolnew1 = icol;
- }
-
- if(smn < 6)
- {
- irownew = 95 - irownew1;
- icolnew = icolnew1;
- }
- else if(smn >= 6 && smn < 12)
- {
- irownew = irownew1;
- icolnew = 47 - icolnew1;
- }
- else if(smn >= 12 && smn < 18)
- {
- irownew = 47 - irownew1;
- icolnew = icolnew1;
- }
- else if(smn >= 18 && smn < 24)
- {
- irownew = irownew1;
- icolnew = 95 - icolnew1;
- }
-
-
-
- GetMCMCh(ddlno, ium, irownew, icolnew, mcmno, chno);
+ TransformS2H(smn,irow,icol);
+ GetMCMCh(ddlno, ium, irow, icol, mcmno, chno);
baseword = 0;
AliBitPacking::PackWord(adc,baseword,0,11);
}
+}
+//____________________________________________________________________________
+void AliPMDDDLRawData::TransformS2H(Int_t smn, Int_t &irow, Int_t &icol)
+{
+ // Does the Software to Hardware coordinate transformation
+ //
+ Int_t irownew = 0;
+ Int_t icolnew = 0;
+ Int_t irownew1 = 0;
+ Int_t icolnew1 = 0;
+
+ // First in digits we have all dimension 48x96
+ // Transform into the realistic one, i.e, For SM 1&2 96x48
+ // and for SM 3&4 48x96
+ //
+ if(smn < 12)
+ {
+ irownew1 = icol;
+ icolnew1 = irow;
+ }
+ else if( smn >= 12 && smn < 24)
+ {
+ irownew1 = irow;
+ icolnew1 = icol;
+ }
+ // This is the transformation of Geant (0,0) to the Hardware (0,0)
+ // which is always at the top left corner. This may change in future.
+ // Then accordingly we have to transform it.
+ if(smn < 6)
+ {
+ irownew = 95 - irownew1;
+ icolnew = icolnew1;
+ }
+ else if(smn >= 6 && smn < 12)
+ {
+ irownew = irownew1;
+ icolnew = 47 - icolnew1;
+ }
+ else if(smn >= 12 && smn < 18)
+ {
+ irownew = 47 - irownew1;
+ icolnew = icolnew1;
+ }
+ else if(smn >= 18 && smn < 24)
+ {
+ irownew = irownew1;
+ icolnew = 95 - icolnew1;
+ }
+
+ irow = irownew;
+ icol = icolnew;
}
+
+
//____________________________________________________________________________
+
void AliPMDDDLRawData::GetMCMCh(Int_t ddlno, Int_t um,
Int_t row, Int_t col,
UInt_t &mcmno, UInt_t &chno)
void WritePMDRawData(TTree *treeD);
void GetUMDigitsData(TTree *treeD, Int_t imodule, Int_t ium, Int_t ddlno,
Int_t & totword, UInt_t *buffer);
+ void TransformS2H(Int_t smn, Int_t &irow, Int_t &icol);
void GetMCMCh(Int_t ddlno, Int_t um, Int_t row, Int_t col,
UInt_t &mcmno, UInt_t &chno);
TClonesArray *fDigits; //! List of digits
AliPMDdigit *fPMDdigit; //! Pointer to digits
- ClassDef(AliPMDDDLRawData,2) // To make RAW Data
+ ClassDef(AliPMDDDLRawData,3) // To make RAW Data
};
#endif
Int_t iddl = fRawReader->GetDDLID();
Int_t ium;
- GetRowCol(iddl, fMCM, fChannel, ium, fRow, fColumn);
-
- if (iddl < 4)
- {
- fModule = iddl*6 + ium;
- fDetector = 0;
- fSMN = iddl*6 + ium;
- }
- else if (iddl == 4)
- {
- if (ium < 6)
- {
- fModule = 24 + ium;
- fSMN = ium;
- }
- else if (ium >= 6)
- {
- fModule = 30 + ium;
- fSMN = 6 + ium;
- }
- fDetector = 1;
- }
- else if (iddl == 5)
- {
-
- if (ium < 6)
- {
- fModule = 30 + ium;
- fSMN = 6 + ium;
- }
- else if (ium >= 6)
- {
- fModule = 36 + ium;
- fSMN = 12 + ium;
- }
- fDetector = 1;
- }
+ GetRowCol(iddl, fMCM, fChannel, ium, fRow, fColumn);
+ ConvertDDL2SMN(iddl, ium, fSMN, fModule, fDetector);
+ TransformH2S(fSMN, fRow, fColumn);
return kTRUE;
}
-
-
//_____________________________________________________________________________
void AliPMDRawStream::GetRowCol(Int_t ddlno, UInt_t mcmno, UInt_t chno,
Int_t &um, Int_t &row, Int_t &col) const
}
}
+//_____________________________________________________________________________
+void AliPMDRawStream::ConvertDDL2SMN(Int_t iddl, Int_t ium, Int_t &smn,
+ Int_t &module, Int_t &detector) const
+{
+ // This converts the DDL number to Module Number which runs from 0-47
+ // Serial module number in one detector which runs from 0-23
+ // Also gives the detector number (0:PRE plane, 1:CPV plane)
+ if (iddl < 4)
+ {
+ module = iddl*6 + ium;
+ detector = 0;
+ smn = iddl*6 + ium;
+ }
+ else if (iddl == 4)
+ {
+ if (ium < 6)
+ {
+ module = 24 + ium;
+ smn = ium;
+ }
+ else if (ium >= 6)
+ {
+ module = 30 + ium;
+ smn = 6 + ium;
+ }
+ detector = 1;
+ }
+ else if (iddl == 5)
+ {
+
+ if (ium < 6)
+ {
+ module = 30 + ium;
+ smn = 6 + ium;
+ }
+ else if (ium >= 6)
+ {
+ module = 36 + ium;
+ smn = 12 + ium;
+ }
+ detector = 1;
+ }
+}
+//_____________________________________________________________________________
+void AliPMDRawStream::TransformH2S(Int_t smn, Int_t &row, Int_t &col) const
+{
+ // Transform the Hardware (0,0) coordinate to Software (0,0) coordinate
+ // and also writes in the digit form
+ // i.e., For SuperModule 1 &2, instead of 96x48 it is 48x96
+ // For Supermodule 3 & 4, 48x96
+
+ Int_t irownew1 = 0;
+ Int_t icolnew1 = 0;
+ Int_t irownew = 0;
+ Int_t icolnew = 0;
+ // Transform all the (0,0) coordinates to the geant frame
+ if(smn < 6)
+ {
+ irownew1 = 95 - row;
+ icolnew1 = col;
+ }
+ else if(smn >= 6 && smn < 12)
+ {
+ irownew1 = row;
+ icolnew1 = 47 - col;
+ }
+ else if(smn >= 12 && smn < 18)
+ {
+ irownew1 = 47 - row;
+ icolnew1 = col;
+ }
+ else if(smn >= 18 && smn < 24)
+ {
+ irownew1 = row;
+ icolnew1 = 95 - col;
+ }
+
+ // for smn < 12 : row = 96, column = 48
+ // for smn>= 12 and < 24 : row = 48, column = 96
+ // In order to make it uniform dimension, smn < 12 are inverted
+ // i.e., row becomes column and column becomes row
+ // for others it remains same
+ // This is further inverted back while calculating eta and phi
+ if(smn < 12)
+ {
+ // SupeModule 1 and 2 : Rows are inverted to columns and vice versa
+ // and at the time of calculating the eta,phi it is again reverted
+ // back
+ irownew = icolnew1;
+ icolnew = irownew1;
+ }
+ else if( smn >= 12 && smn < 24)
+ {
+ irownew = irownew1;
+ icolnew = icolnew1;
+ }
+
+ row = irownew;
+ col = icolnew;
+}
+//_____________________________________________________________________________
void GetRowCol(Int_t ddlno, UInt_t mcmno, UInt_t chno,
Int_t &um, Int_t &row, Int_t &col) const;
+ void ConvertDDL2SMN(Int_t iddl, Int_t ium, Int_t &smn,
+ Int_t &module, Int_t &detector) const;
+ void TransformH2S(Int_t smn, Int_t &row, Int_t &col) const;
AliRawReader* fRawReader; // object for reading the raw data
Int_t fDetector; // PRE = 0, CPV = 1
Int_t fSMN; // serial module number (0-23)
- ClassDef(AliPMDRawStream, 0) // class for reading PMD raw digits
+ ClassDef(AliPMDRawStream, 1) // class for reading PMD raw digits
};
#endif