/*
$Log$
+Revision 1.18 2000/05/08 16:17:27 cblume
+Merge TRD-develop
+
Revision 1.17.2.1 2000/05/08 14:28:59 cblume
Introduced SetPHOShole() and SetRICHhole(). AliTRDrecPoint container is now a TObjArray
}
//_____________________________________________________________________________
-void AliTRD::AddDigit(Int_t *digits)
+void AliTRD::AddDigit(Int_t *digits, Int_t *amp)
{
//
// Add a digit for the TRD
//
TClonesArray &ldigits = *fDigits;
- new(ldigits[fNdigits++]) AliTRDdigit(kFALSE,digits);
+ new(ldigits[fNdigits++]) AliTRDdigit(kFALSE,digits,amp);
}
//_____________________________________________________________________________
-void AliTRD::AddHit(Int_t track, Int_t det, Float_t *hits)
+void AliTRD::AddHit(Int_t track, Int_t* det, Float_t *hits)
{
//
// Add a hit for the TRD
AliTRD();
AliTRD(const char *name, const char *title);
virtual ~AliTRD();
- virtual void AddHit(Int_t, Int_t, Float_t*);
- virtual void AddDigit(Int_t*);
+ virtual void AddHit(Int_t, Int_t*, Float_t*);
+ virtual void AddDigit(Int_t*, Int_t*);
virtual void AddRecPoint(Float_t*, Int_t*, Int_t, Float_t);
virtual void BuildGeometry();
virtual void CreateGeometry();
virtual void SetTreeAddress();
virtual void SetGasMix(Int_t imix = 0);
- virtual void SetHits(Int_t ihit = 1) {};
+ virtual void SetHits() {};
virtual void SetPHOShole() { fGeometry->SetPHOShole(); };
virtual void SetRICHhole() { fGeometry->SetRICHhole(); };
AliTRDgeometry *GetGeometry() { return fGeometry; };
- virtual void SetSensChamber(Int_t ichamber) = 0;
- virtual void SetSensPlane(Int_t iplane) = 0;
- virtual void SetSensSector(Int_t isector) = 0;
+ virtual void SetSensChamber(Int_t ichamber) = 0;
+ virtual void SetSensPlane(Int_t iplane) = 0;
+ virtual void SetSensSector(Int_t isector) = 0;
+ virtual void SetSensSector(Int_t isector, Int_t nsector) = 0;
+
+ virtual Int_t GetSensChamber() = 0;
+ virtual Int_t GetSensPlane() = 0;
+ virtual Int_t GetSensSector() = 0;
+ virtual Int_t GetSensSectorRange() = 0;
- virtual Int_t GetSensChamber() = 0;
- virtual Int_t GetSensPlane() = 0;
- virtual Int_t GetSensSector() = 0;
-
protected:
Int_t fGasMix; // Gas mixture. 0: Xe/Isobutane 1: Xe/CO2
/*
$Log$
+Revision 1.2 2000/05/08 16:17:27 cblume
+Merge TRD-develop
+
Revision 1.1.4.1 2000/05/08 15:08:41 cblume
Replace AliTRDcluster by AliTRDrecPoint
Int_t idxSave[nSave];
Int_t iSave = 0;
- const Int_t nTrack = 3;
- Int_t tracks[nTrack];
+ const Int_t nSaveTrack = 3;
+ Int_t tracks[nSaveTrack];
tracks[0] = RecPoint1->GetDigit(0);
// Check the other cluster to see, whether there are close ones
else {
idxSave[iSave] = iClus2;
iSave++;
- if (iSave < nTrack) tracks[iSave] = RecPoint2->GetDigit(0);
+ if (iSave < nSaveTrack) tracks[iSave] = RecPoint2->GetDigit(0);
}
}
}
/*
$Log$
+Revision 1.3 2000/05/08 16:17:27 cblume
+Merge TRD-develop
+
Revision 1.1.4.1 2000/05/08 15:09:01 cblume
Introduce AliTRDdigitsManager
Int_t chamBeg = 0;
Int_t chamEnd = kNcham;
- if (TRD->GetSensChamber() >= 0) {
+ if (TRD->GetSensChamber() >= 0) {
chamBeg = TRD->GetSensChamber();
chamEnd = chamBeg + 1;
}
Int_t planBeg = 0;
Int_t planEnd = kNplan;
- if (TRD->GetSensPlane() >= 0) {
+ if (TRD->GetSensPlane() >= 0) {
planBeg = TRD->GetSensPlane();
planEnd = planBeg + 1;
}
Int_t sectBeg = 0;
Int_t sectEnd = kNsect;
- if (TRD->GetSensSector() >= 0) {
- sectBeg = TRD->GetSensSector();
- sectEnd = sectBeg + 1;
- }
// *** Start clustering *** in every chamber
for (Int_t icham = chamBeg; icham < chamEnd; icham++) {
for (Int_t iplan = planBeg; iplan < planEnd; iplan++) {
for (Int_t isect = sectBeg; isect < sectEnd; isect++) {
+ if (TRD->GetSensSector() >= 0) {
+ Int_t sens1 = TRD->GetSensSector();
+ Int_t sens2 = sens1 + TRD->GetSensSectorRange();
+ sens2 -= ((Int_t) (sens2 / kNsect)) * kNsect;
+ if (sens1 < sens2)
+ if ((isect < sens1) || (isect >= sens2)) continue;
+ else
+ if ((isect < sens1) && (isect >= sens2)) continue;
+ }
+
Int_t idet = Geo->GetDetector(iplan,icham,isect);
Int_t nClusters = 0;
// Cluster digit info
Int_t clusterDigit[nClus] = {0};
- for (Int_t iPad = 0; iPad < nClus; iPad++) {
+ Int_t iPad;
+ for (iPad = 0; iPad < nClus; iPad++) {
clusterSignal[iPad] = digitMatrix->GetSignal(row,col-1+iPad,time);
clusterDigit[iPad] = digitMatrix->GetTrack(row,col-1+iPad,time,0);
}
if (col < nColMax - 2) {
if (maximaMatrix->GetSignal(row,col + 2,time) > 0) {
- for (Int_t iPad = 0; iPad < 5; iPad++) {
+ for (iPad = 0; iPad < 5; iPad++) {
padSignal[iPad] = digitMatrix->GetSignal(row,col-1+iPad,time);
}
/*
$Log$
+Revision 1.3 2000/05/18 07:56:44 cblume
+Added #include <stdlib.h>
+
Revision 1.2 2000/05/08 16:17:27 cblume
Merge TRD-develop
}
+//_____________________________________________________________________________
+Int_t AliTRDdataArray::GetIdx1(Int_t row, Int_t col)
+{
+ //
+ // Maps the two-dimensional row/column plane into an one-dimensional array.
+ //
+
+ if (row >= fNrow) {
+ TObject::Error("GetIdx1"
+ ,"row %d out of bounds (size: %d, this: 0x%08x)"
+ ,row,fNrow,this);
+ return -1;
+ }
+
+ if (col >= fNcol) {
+ TObject::Error("GetIdx1"
+ ,"col %d out of bounds (size: %d, this: 0x%08x)"
+ ,col,fNcol,this);
+ return -1;
+ }
+
+ return row + col * fNrow;
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDdataArray::GetIndex(Int_t row, Int_t col, Int_t time)
+{
+ //
+ // Maps the row/column/time into one number
+ //
+
+ if (time > fNtime) {
+ TObject::Error("GetIdx1"
+ ,"time %d out of bounds (size: %d, this: 0x%08x)"
+ ,time,fNtime,this);
+ return -1;
+ }
+
+ return time * fNrow*fNcol + GetIdx1(row,col);
+
+}
virtual Int_t GetNCol() { return fNcol; };
virtual Int_t GetNtime() { return fNtime; };
- inline Int_t GetIndex(Int_t row, Int_t col, Int_t time);
+ Int_t GetIndex(Int_t row, Int_t col, Int_t time);
protected:
- inline Int_t GetIdx1(Int_t row, Int_t col);
+ Int_t GetIdx1(Int_t row, Int_t col);
inline Bool_t CheckBounds(const char *where, Int_t idx1, Int_t idx2);
inline Bool_t OutOfBoundsError(const char *where, Int_t idx1, Int_t idx2);
};
-//_____________________________________________________________________________
-inline Int_t AliTRDdataArray::GetIndex(Int_t row, Int_t col, Int_t time)
-{
- //
- // Maps the row/column/time into one number
- //
-
- if (time > fNtime) {
- TObject::Error("GetIdx1"
- ,"time %d out of bounds (size: %d, this: 0x%08x)"
- ,time,fNtime,this);
- return -1;
- }
-
- return time * fNrow*fNcol + GetIdx1(row,col);
-
-}
-
-//_____________________________________________________________________________
-inline Int_t AliTRDdataArray::GetIdx1(Int_t row, Int_t col)
-{
- //
- // Maps the two-dimensional row/column plane into an one-dimensional array.
- //
-
- if (row >= fNrow) {
- TObject::Error("GetIdx1"
- ,"row %d out of bounds (size: %d, this: 0x%08x)"
- ,row,fNrow,this);
- return -1;
- }
-
- if (col >= fNcol) {
- TObject::Error("GetIdx1"
- ,"col %d out of bounds (size: %d, this: 0x%08x)"
- ,col,fNcol,this);
- return -1;
- }
-
- return row + col * fNrow;
-
-}
-
//_____________________________________________________________________________
inline Bool_t AliTRDdataArray::CheckBounds(const char *where
, Int_t idx1, Int_t idx2)
/*
$Log$
+Revision 1.2 2000/05/08 16:17:27 cblume
+Merge TRD-develop
+
Revision 1.1.2.1 2000/05/08 14:40:29 cblume
Introduce raw digit bit flag and DecodeAmp()
}
//_____________________________________________________________________________
-AliTRDdigit::AliTRDdigit(Bool_t isRaw, Int_t *digits):AliDigitNew()
+AliTRDdigit::AliTRDdigit(Bool_t isRaw, Int_t *digits, Int_t *amp):AliDigitNew()
{
//
// Create a TRD digit
fTime = digits[3];
// Store the signal amplitude
- fAmp = digits[4];
+ fAmp = amp[0];
if (isRaw) SetBit(kRawDigit);
public:
AliTRDdigit();
- AliTRDdigit(Bool_t isRaw, Int_t *digits);
+ AliTRDdigit(Bool_t isRaw, Int_t *digits, Int_t *amp);
~AliTRDdigit() {};
- Int_t GetAmp() { if (TestBit(kRawDigit))
- return DecodeAmp();
- else
- return fAmp; };
- Int_t GetDetector() { return fId; };
- Int_t GetRow() { return fRow; };
- Int_t GetCol() { return fCol; };
- Int_t GetTime() { return fTime; };
+ Int_t GetAmp() const { if (TestBit(kRawDigit))
+ return DecodeAmp();
+ else
+ return fAmp; };
+ Int_t GetDetector() { return fId; };
+ Int_t GetRow() { return fRow; };
+ Int_t GetCol() { return fCol; };
+ Int_t GetTime() { return fTime; };
- Int_t DecodeAmp() { return 0; };
+ Int_t DecodeAmp() const { return 0; };
protected:
/*
$Log$
+Revision 1.5 2000/05/09 16:38:57 cblume
+Removed PadResponse(). Merge problem
+
Revision 1.4 2000/05/08 15:53:45 cblume
Resolved merge conflict
Int_t chamBeg = 0;
Int_t chamEnd = kNcham;
- if (fTRD->GetSensChamber() >= 0) {
+ if (fTRD->GetSensChamber() >= 0) {
chamBeg = fTRD->GetSensChamber();
chamEnd = chamBeg + 1;
}
Int_t planBeg = 0;
Int_t planEnd = kNplan;
- if (fTRD->GetSensPlane() >= 0) {
+ if (fTRD->GetSensPlane() >= 0) {
planBeg = fTRD->GetSensPlane();
planEnd = planBeg + 1;
}
Int_t sectBeg = 0;
Int_t sectEnd = kNsect;
- if (fTRD->GetSensSector() >= 0) {
- sectBeg = fTRD->GetSensSector();
- sectEnd = sectBeg + 1;
- }
Int_t count_hits = 0;
for (Int_t iPlan = planBeg; iPlan < planEnd; iPlan++) {
for (Int_t iSect = sectBeg; iSect < sectEnd; iSect++) {
+ if (fTRD->GetSensSector() >= 0) {
+ Int_t sens1 = fTRD->GetSensSector();
+ Int_t sens2 = sens1 + fTRD->GetSensSectorRange();
+ sens2 -= ((Int_t) (sens2 / kNsect)) * kNsect;
+ if (sens1 < sens2)
+ if ((iSect < sens1) || (iSect >= sens2)) continue;
+ else
+ if ((iSect < sens1) && (iSect >= sens2)) continue;
+ }
+
Int_t nDigits = 0;
printf("AliTRDdigitizer::MakeDigits -- ");
/*
$Log$
+Revision 1.2 2000/05/08 16:17:27 cblume
+Merge TRD-develop
+
Revision 1.1.2.1 2000/05/08 14:44:01 cblume
Add new class AliTRDdigitsManager
return kTRUE;
}
+
+//_____________________________________________________________________________
+AliTRDdigit *AliTRDdigitsManager::GetDigit(Int_t row, Int_t col
+ , Int_t time, Int_t det)
+{
+ //
+ // Creates a single digit object
+ //
+
+ Int_t digits[4];
+ Int_t amp[1];
+
+ digits[0] = det;
+ digits[1] = row;
+ digits[2] = col;
+ digits[3] = time;
+
+ amp[0] = GetDigits(det)->GetData(row,col,time);
+
+ return (new AliTRDdigit(fIsRaw,digits,amp));
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDdigitsManager::GetTrack(Int_t track
+ , Int_t row, Int_t col, Int_t time
+ , Int_t det)
+{
+ //
+ // Returns the MC-track numbers from the dictionary.
+ //
+
+ if ((track < 0) || (track >= kNDict)) {
+ TObject::Error("GetTracks"
+ ,"track %d out of bounds (size: %d, this: 0x%08x)"
+ ,track,kNDict,this);
+ return -1;
+ }
+
+ // Array contains index+1 to allow data compression
+ return (GetDictionary(det,track)->GetData(row,col,time) - 1);
+
+}
+
virtual AliTRDsegmentArray *GetDigits() { return fDigits; };
virtual AliTRDsegmentArray *GetDictionary(Int_t i) { return fDictionary[i]; };
+ AliTRDdigit *GetDigit(Int_t row, Int_t col, Int_t time, Int_t det);
+ Int_t GetTrack(Int_t track, Int_t row, Int_t col, Int_t time, Int_t det);
+
inline AliTRDdataArrayI *GetDigits(Int_t det);
inline AliTRDdataArrayI *GetDictionary(Int_t det, Int_t i);
- inline AliTRDdigit *GetDigit(Int_t row, Int_t col, Int_t time, Int_t det);
- inline Int_t GetTrack(Int_t track, Int_t row, Int_t col, Int_t time, Int_t det);
inline Int_t GetTrack(Int_t track, AliTRDdigit *Digit);
protected:
}
-
//_____________________________________________________________________________
inline AliTRDdataArrayI *AliTRDdigitsManager::GetDictionary(Int_t det, Int_t i)
{
}
-//_____________________________________________________________________________
-inline AliTRDdigit *AliTRDdigitsManager::GetDigit(Int_t row, Int_t col
- , Int_t time, Int_t det)
-{
- //
- // Creates a single digit object
- //
-
- Int_t digits[5];
-
- digits[0] = det;
- digits[1] = row;
- digits[2] = col;
- digits[3] = time;
- digits[4] = GetDigits(det)->GetData(row,col,time);
-
- return (new AliTRDdigit(fIsRaw,digits));
-
-}
-
-//_____________________________________________________________________________
-inline Int_t AliTRDdigitsManager::GetTrack(Int_t track
- , Int_t row, Int_t col, Int_t time
- , Int_t det)
-{
- //
- // Returns the MC-track numbers from the dictionary.
- //
-
- if ((track < 0) || (track >= kNDict)) {
- TObject::Error("GetTracks"
- ,"track %d out of bounds (size: %d, this: 0x%08x)"
- ,track,kNDict,this);
- return -1;
- }
-
- // Array contains index+1 to allow data compression
- return (GetDictionary(det,track)->GetData(row,col,time) - 1);
-
-}
-
//_____________________________________________________________________________
inline Int_t AliTRDdigitsManager::GetTrack(Int_t track, AliTRDdigit *Digit)
{
/*
$Log$
+Revision 1.2 2000/05/08 16:17:27 cblume
+Merge TRD-develop
+
Revision 1.1.4.1 2000/05/08 14:45:55 cblume
Bug fix in RotateBack(). Geometry update
//
GetGlobal(p,pos);
+ mat.Zero();
}
/*
$Log$
+Revision 1.2 2000/05/08 16:17:27 cblume
+Merge TRD-develop
+
Revision 1.1.2.1 2000/05/08 14:48:31 cblume
AliTRDhit class now in separate files
ClassImp(AliTRDhit)
//_____________________________________________________________________________
-AliTRDhit::AliTRDhit(Int_t shunt, Int_t track, Int_t det, Float_t *hits)
+AliTRDhit::AliTRDhit(Int_t shunt, Int_t track, Int_t *det, Float_t *hits)
:AliHit(shunt, track)
{
//
//
// Store volume hierarchy
- fDetector = det;
+ fDetector = det[0];
// Store position and charge
fX = hits[0];
public:
AliTRDhit() {}
- AliTRDhit(Int_t shunt, Int_t track, Int_t det, Float_t *hits);
+ AliTRDhit(Int_t shunt, Int_t track, Int_t *det, Float_t *hits);
virtual ~AliTRDhit() {};
ClassDef(AliTRDhit,2) // Hit for the Transition Radiation Detector
AliTRDrecPoint();
~AliTRDrecPoint() {};
- virtual void Print(Option_t * opt = "void") {};
+ virtual void Print(Option_t* ) {};
virtual void AddDigit(Int_t digit);
+ virtual void AddDigit(AliDigitNew &digit) {};
virtual void SetEnergy(Float_t amp) { fAmp = amp; };
virtual void SetDetector(Int_t det) { fDetector = det; };
~AliTRDsegmentArray() { };
virtual void Delete();
+ virtual void Delete(const char *) { Delete(); };
virtual Bool_t LoadArray(const Char_t *branchname);
virtual Bool_t StoreArray(const Char_t *branchname);
/*
$Log$
+Revision 1.2 2000/05/08 16:17:27 cblume
+Merge TRD-develop
+
Revision 1.1.4.1 2000/05/08 14:55:03 cblume
Bug fixes
}
return kTRUE;
}
+
+//_____________________________________________________________________________
+const AliTRDsegmentID* AliTRDsegmentArrayBase::operator[](Int_t i)
+{
+ //
+ //return segment with given index
+ //
+ if ( (i<0) || (i>=fNSegment)) return 0;
+ return (AliTRDsegmentID *)fSegment->At(i);
+}
+
+//_____________________________________________________________________________
+const AliTRDsegmentID* AliTRDsegmentArrayBase::At(Int_t i)
+{
+ //
+ //return segment with given index
+ //
+ if ( (i<0) || (i>=fNSegment)) return 0;
+ return (AliTRDsegmentID *)((*fSegment)[i]);
+}
AliTRDsegmentArrayBase(Text_t *classname, Int_t n); //
Bool_t SetClass(Text_t *classname); //set class of stored object
~AliTRDsegmentArrayBase();
- inline const AliTRDsegmentID * At(Int_t i); //return pointer to segment with index i
- inline const AliTRDsegmentID * operator[](Int_t i); //return pointer to segment with index i
+ const AliTRDsegmentID * At(Int_t i); //return pointer to segment with index i
+ const AliTRDsegmentID * operator[](Int_t i); //return pointer to segment with index i
Bool_t AddSegment(AliTRDsegmentID *segment); // add segment to array
AliTRDsegmentID * AddSegment(Int_t index); //create objet and set index
ClassDef(AliTRDsegmentArrayBase,1)
};
-
-
-const AliTRDsegmentID* AliTRDsegmentArrayBase::operator[](Int_t i)
-{
- //
- //return segment with given index
- //
- if ( (i<0) || (i>=fNSegment)) return 0;
- return (AliTRDsegmentID *)fSegment->At(i);
-}
-const AliTRDsegmentID* AliTRDsegmentArrayBase::At(Int_t i)
-{
- //
- //return segment with given index
- //
- if ( (i<0) || (i>=fNSegment)) return 0;
- return (AliTRDsegmentID *)((*fSegment)[i]);
-}
-
#endif //ALISEGARRAY_H
/*
$Log$
+Revision 1.14 2000/02/28 19:10:26 cblume
+Include the new TRD classes
+
Revision 1.13.4.1 2000/02/28 18:01:53 cblume
Change to new hit version and introduce geometry class
Int_t iIdChamber, icChamber;
Float_t hits[4];
+ Int_t det[1];
TLorentzVector p;
TClonesArray &lhits = *fHits;
// The plane number (0 - 5)
pla = icChamber - TMath::Nint((Float_t) (icChamber / 7)) * 6 - 1;
+ det[0] = fGeometry->GetDetector(pla,cha,sec);
new(lhits[fNhits++]) AliTRDhit(fIshunt
,gAlice->CurrentTrack()
- ,fGeometry->GetDetector(pla,cha,sec)
+ ,det
,hits);
}
~AliTRDv0() {};
virtual void CreateGeometry();
virtual void CreateMaterials();
- virtual Int_t IsVersion() const { return 0; };
+ virtual Int_t IsVersion() const { return 0; };
virtual void StepManager();
virtual void Init();
- virtual void SetHits(Int_t ihit = 1) { fHitsOn = ihit; };
+ virtual void SetHits() { fHitsOn = 1; };
- void SetSensChamber(Int_t ichamber) { };
- void SetSensPlane(Int_t iplane) { };
- void SetSensSector(Int_t isector) { };
+ void SetSensChamber(Int_t ) { };
+ void SetSensPlane(Int_t ) { };
+ void SetSensSector(Int_t ) { };
+ void SetSensSector(Int_t ,Int_t) { };
- Int_t GetSensChamber() { return 0; };
- Int_t GetSensPlane() { return 0; };
- Int_t GetSensSector() { return 0; };
+ Int_t GetSensChamber() { return 0; };
+ Int_t GetSensPlane() { return 0; };
+ Int_t GetSensSector() { return 0; };
+ Int_t GetSensSectorRange() { return 0; };
protected:
/*
$Log$
+Revision 1.18 2000/05/08 16:17:27 cblume
+Merge TRD-develop
+
Revision 1.17.2.1 2000/05/08 14:59:16 cblume
Made inline function non-virtual. Bug fix in setting sensitive chamber
// Standard constructor for Transition Radiation Detector version 1
//
- fIdSens = 0;
+ fIdSens = 0;
- fIdChamber1 = 0;
- fIdChamber2 = 0;
- fIdChamber3 = 0;
+ fIdChamber1 = 0;
+ fIdChamber2 = 0;
+ fIdChamber3 = 0;
- fSensSelect = 0;
- fSensPlane = -1;
- fSensChamber = -1;
- fSensSector = -1;
+ fSensSelect = 0;
+ fSensPlane = -1;
+ fSensChamber = -1;
+ fSensSector = -1;
+ fSensSectorRange = 0;
- fDeltaE = NULL;
+ fDeltaE = NULL;
SetBufferSize(128000);
printf(" Only plane %d is sensitive\n",fSensPlane);
if (fSensChamber >= 0)
printf(" Only chamber %d is sensitive\n",fSensChamber);
- if (fSensSector >= 0)
- printf(" Only sector %d is sensitive\n",fSensSector);
+ if (fSensSector >= 0) {
+ Int_t sens1 = fSensSector;
+ Int_t sens2 = fSensSector + fSensSectorRange;
+ sens2 -= ((Int_t) (sens2 / kNsect)) * kNsect;
+ printf(" Only sectors %d - %d are sensitive\n",sens1,sens2-1);
+ }
}
printf("\n");
// Defines the hit-sensitive sector (0-17)
//
+ SetSensSector(isector,1);
+
+}
+
+//_____________________________________________________________________________
+void AliTRDv1::SetSensSector(Int_t isector, Int_t nsector)
+{
+ //
+ // Defines a range of hit-sensitive sectors. The range is defined by
+ // <isector> (0-17) as the starting point and <nsector> as the number
+ // of sectors to be included.
+ //
+
if ((isector < 0) || (isector > 17)) {
- printf("Wrong input value: %d\n",isector);
+ printf("Wrong input value <isector>: %d\n",isector);
printf("Use standard setting\n");
- fSensSector = -1;
- fSensSelect = 0;
+ fSensSector = -1;
+ fSensSectorRange = 0;
+ fSensSelect = 0;
return;
}
- fSensSelect = 1;
- fSensSector = isector;
+ if ((nsector < 1) || (nsector > 18)) {
+ printf("Wrong input value <nsector>: %d\n",nsector);
+ printf("Use standard setting\n");
+ fSensSector = -1;
+ fSensSectorRange = 0;
+ fSensSelect = 0;
+ return;
+ }
+
+ fSensSelect = 1;
+ fSensSector = isector;
+ fSensSectorRange = nsector;
}
Int_t sec = 0;
Int_t iPdg;
+ Int_t det[1];
+
Float_t hits[4];
Float_t random[1];
Float_t charge;
if (fSensSelect) {
if ((fSensPlane >= 0) && (pla != fSensPlane )) addthishit = 0;
if ((fSensChamber >= 0) && (cha != fSensChamber)) addthishit = 0;
- if ((fSensSector >= 0) && (sec != fSensSector )) addthishit = 0;
+ if (fSensSector >= 0) {
+ Int_t sens1 = fSensSector;
+ Int_t sens2 = fSensSector + fSensSectorRange;
+ sens2 -= ((Int_t) (sens2 / kNsect)) * kNsect;
+ if (sens1 < sens2) {
+ if ((sec < sens1) || (sec >= sens2)) addthishit = 0;
+ }
+ else {
+ if ((sec < sens1) && (sec >= sens2)) addthishit = 0;
+ }
+ }
}
// Add this hit
if (addthishit) {
+ det[0] = fGeometry->GetDetector(pla,cha,sec);
new(lhits[fNhits++]) AliTRDhit(fIshunt
,gAlice->CurrentTrack()
- ,fGeometry->GetDetector(pla,cha,sec)
+ ,det
,hits);
// The energy loss according to Bethe Bloch
void SetSensPlane(Int_t iplane = 0);
void SetSensChamber(Int_t ichamber = 0);
- void SetSensSector(Int_t isector = 0);
+ void SetSensSector(Int_t isector);
+ void SetSensSector(Int_t isector, Int_t nsector);
- Int_t GetSensPlane() { return fSensPlane; };
- Int_t GetSensChamber() { return fSensChamber; };
- Int_t GetSensSector() { return fSensSector; };
+ Int_t GetSensPlane() { return fSensPlane; };
+ Int_t GetSensChamber() { return fSensChamber; };
+ Int_t GetSensSector() { return fSensSector; };
+ Int_t GetSensSectorRange() { return fSensSectorRange; };
protected:
Int_t fSensSelect; // Switch to select only parts of the detector
Int_t fSensPlane; // Sensitive detector plane
Int_t fSensChamber; // Sensitive detector chamber
- Int_t fSensSector; // Sensitive detector sector
+ Int_t fSensSector; // Sensitive detector sector
+ Int_t fSensSectorRange; // Sensitive detector range
private: