--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Geometry class for a single ROC //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+#include "AliTPCROC.h"
+#include "TMath.h"
+
+ClassImp(AliTPCROC)
+
+
+AliTPCROC* AliTPCROC::fgInstance = 0;
+
+
+
+
+//_ singleton implementation __________________________________________________
+AliTPCROC* AliTPCROC::Instance()
+{
+ //
+ // Singleton implementation
+ // Returns an instance of this class, it is created if neccessary
+ //
+ if (fgInstance == 0){
+ fgInstance = new AliTPCROC();
+ fgInstance->Init();
+ }
+ return fgInstance;
+}
+
+
+
+
+void AliTPCROC::Init(){
+ //
+ // initialize static variables
+ //
+ if (AliTPCROC::fNSectorsAll>0) return;
+ fNSectorsAll =72;
+ fNSectors[0] =36;
+ fNSectors[1] =36;
+ //
+ fNRows[0]= 63;
+ fNRows[1]= 96;
+ //
+ // number of pads in padrow
+ fNPads[0] = new Int_t[fNRows[0]];
+ fNPads[1] = new Int_t[fNRows[1]];
+ //
+ // padrow index in array
+ //
+ fRowPosIndex[0] = new Int_t[fNRows[0]];
+ fRowPosIndex[1] = new Int_t[fNRows[1]];
+ //
+ // inner sectors
+ //
+ Int_t index =0;
+ for (Int_t irow=0; irow<fNRows[0];irow++){
+ Int_t npads = (irow==0) ? 68 : 2 *Int_t(Double_t(irow)/3. +33.67);
+ fNPads[0][irow] = npads;
+ fRowPosIndex[0][irow] = index;
+ index+=npads;
+ }
+ fNChannels[0] = index;
+ //
+ index =0;
+ Double_t k1 = 10.*TMath::Tan(10*TMath::DegToRad())/6.;
+ Double_t k2 = 15.*TMath::Tan(10*TMath::DegToRad())/6.;
+ for (Int_t irow=0; irow<fNRows[1];irow++){
+ Int_t npads = (irow<64) ?
+ 2*Int_t(k1*Double_t(irow)+37.75):
+ 2*Int_t(k2*Double_t(irow-64)+56.66);
+ fNPads[1][irow] = npads;
+ fRowPosIndex[1][irow] = index;
+ index+=npads;
+ }
+ fNChannels[1] = index;
+ SetGeometry();
+}
+
+
+
+
+void AliTPCROC::SetGeometry()
+{
+ //
+ //set ROC geometry parameters
+ //
+ const Float_t kInnerRadiusLow = 83.65;
+ const Float_t kInnerRadiusUp = 133.3;
+ const Float_t kOuterRadiusLow = 133.5;
+ const Float_t kOuterRadiusUp = 247.7;
+ const Float_t kInnerFrameSpace = 1.5;
+ const Float_t kOuterFrameSpace = 1.5;
+ const Float_t kInnerWireMount = 1.2;
+ const Float_t kOuterWireMount = 1.4;
+ const Float_t kZLength =250.;
+ const Int_t kNRowLow = 63;
+ const Int_t kNRowUp1 = 64;
+ const Int_t kNRowUp2 = 32;
+ const Int_t kNRowUp = 96;
+ const Float_t kInnerAngle = 20; // 20 degrees
+ const Float_t kOuterAngle = 20; // 20 degrees
+ //
+ // pad parameters
+ //
+ const Float_t kInnerPadPitchLength = 0.75;
+ const Float_t kInnerPadPitchWidth = 0.40;
+ const Float_t kInnerPadLength = 0.75;
+ const Float_t kInnerPadWidth = 0.40;
+ const Float_t kOuter1PadPitchLength = 1.0;
+ const Float_t kOuterPadPitchWidth = 0.6;
+ const Float_t kOuter1PadLength = 1.0;
+ const Float_t kOuterPadWidth = 0.6;
+ const Float_t kOuter2PadPitchLength = 1.5;
+ const Float_t kOuter2PadLength = 1.5;
+
+ //
+ //wires default parameters
+ //
+// const Int_t kNInnerWiresPerPad = 3;
+// const Int_t kInnerDummyWire = 2;
+// const Float_t kInnerWWPitch = 0.25;
+// const Float_t kRInnerFirstWire = 84.475;
+// const Float_t kRInnerLastWire = 132.475;
+// const Float_t kInnerOffWire = 0.5;
+// const Int_t kNOuter1WiresPerPad = 4;
+// const Int_t kNOuter2WiresPerPad = 6;
+// const Float_t kOuterWWPitch = 0.25;
+// const Float_t kROuterFirstWire = 134.225;
+// const Float_t kROuterLastWire = 246.975;
+// const Int_t kOuterDummyWire = 2;
+// const Float_t kOuterOffWire = 0.5;
+ //
+ //set sector parameters
+ //
+ fInnerRadiusLow = kInnerRadiusLow;
+ fOuterRadiusLow = kOuterRadiusLow;
+ fInnerRadiusUp = kInnerRadiusUp;
+ fOuterRadiusUp = kOuterRadiusUp;
+ fInnerFrameSpace = kInnerFrameSpace;
+ fOuterFrameSpace = kOuterFrameSpace;
+ fInnerWireMount = kInnerWireMount;
+ fOuterWireMount = kOuterWireMount;
+ fZLength = kZLength;
+ fInnerAngle = TMath::DegToRad()*kInnerAngle;
+ fOuterAngle = TMath::DegToRad()*kOuterAngle;
+
+ fNRowLow = kNRowLow;
+ fNRowUp1 = kNRowUp1;
+ fNRowUp2 = kNRowUp2;
+ fNRowUp = kNRowUp;
+ //
+ //set pad parameter
+ //
+ fInnerPadPitchLength = kInnerPadPitchLength;
+ fInnerPadPitchWidth = kInnerPadPitchWidth;
+ fInnerPadLength = kInnerPadLength;
+ fInnerPadWidth = kInnerPadWidth;
+ fOuter1PadPitchLength = kOuter1PadPitchLength;
+ fOuter2PadPitchLength = kOuter2PadPitchLength;
+ fOuterPadPitchWidth = kOuterPadPitchWidth;
+ fOuter1PadLength = kOuter1PadLength;
+ fOuter2PadLength = kOuter2PadLength;
+ fOuterPadWidth = kOuterPadWidth;
+
+ //
+ //set wire parameters
+ //
+ // SetInnerNWires(kNInnerWiresPerPad);
+ // SetInnerDummyWire(kInnerDummyWire);
+ // SetInnerOffWire(kInnerOffWire);
+ // SetOuter1NWires(kNOuter1WiresPerPad);
+ // SetOuter2NWire(kNOuter2WiresPerPad);
+ // SetOuterDummyWire(kOuterDummyWire);
+ // SetOuterOffWire(kOuterOffWire);
+ // SetInnerWWPitch(kInnerWWPitch);
+ // SetRInnerFirstWire(kRInnerFirstWire);
+ // SetRInnerLastWire(kRInnerLastWire);
+ // SetOuterWWPitch(kOuterWWPitch);
+ // SetROuterFirstWire(kROuterFirstWire);
+ // SetROuterLastWire(kROuterLastWire);
+}
+
+
+
+
+//_____________________________________________________________________________
+AliTPCROC::AliTPCROC():TObject(), fNSectorsAll(0)
+{
+ //
+ // Default constructor
+ for (Int_t i=0;i<2;i++){
+ fNSectors[i] = 0;
+ fNRows[i] = 0;
+ fNChannels[i] = 0;
+ fNPads[i] = 0;
+ fRowPosIndex[i]= 0;
+ }
+}
+
+
+//_____________________________________________________________________________
+AliTPCROC::AliTPCROC(const AliTPCROC &roc):TObject(roc)
+{
+ //
+ // AliTPCROC copy constructor
+ //
+ fNSectorsAll = roc.fNSectorsAll;
+ fNSectors[0] = roc.fNSectors[0];
+ fNSectors[1] = roc.fNSectors[1];
+ fNRows[0] = roc.fNRows[0];
+ fNRows[1] = roc.fNRows[1];
+ fNChannels[0]= roc.fNChannels[0];
+ fNChannels[1]= roc.fNChannels[1];
+ //
+ // number of pads in padrow
+ fNPads[0] = new Int_t[fNRows[0]];
+ fNPads[1] = new Int_t[fNRows[1]];
+ //
+ // padrow index in array
+ //
+ fRowPosIndex[0] = new Int_t[fNRows[0]];
+ fRowPosIndex[1] = new Int_t[fNRows[1]];
+ //
+ for (Int_t irow =0; irow<fNRows[0];irow++){
+ fNPads[0][irow] = roc.fNPads[0][irow];
+ fRowPosIndex[0][irow] = roc.fRowPosIndex[0][irow];
+ }
+ for (Int_t irow =0; irow<fNRows[1];irow++){
+ fNPads[1][irow] = roc.fNPads[1][irow];
+ fRowPosIndex[1][irow] = roc.fRowPosIndex[1][irow];
+ }
+}
+
+//_____________________________________________________________________________
+AliTPCROC::~AliTPCROC()
+{
+ //
+ // AliTPCROC destructor
+ //
+ delete [] fNPads[0];
+ delete [] fNPads[1];
+ delete [] fRowPosIndex[0];
+ delete [] fRowPosIndex[1];
+
+}
+
--- /dev/null
+#ifndef ALITPCROC_H
+#define ALITPCROC_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id: AliTPCROC.h,v */
+
+//////////////////////////////////////////////////
+// //
+// TPC geometry class for ROC //
+// //
+//////////////////////////////////////////////////
+
+#include <TObject.h>
+
+//_____________________________________________________________________________
+class AliTPCROC : public TObject {
+ public:
+ static AliTPCROC* Instance();
+ AliTPCROC();
+ AliTPCROC(const AliTPCROC &roc);
+ void Init();
+ virtual ~AliTPCROC();
+
+ //
+ // numbering
+ Int_t GetNSectors() const { return fNSectorsAll;}
+ Int_t GetNRows(Int_t sector) const { return (sector<fNSectors[1]) ? fNRows[0]:fNRows[1];}
+ Int_t GetNChannels(Int_t sector) const { return (sector<fNSectors[1]) ? fNChannels[0]:fNChannels[1];}
+ Int_t GetNPads(Int_t sector,Int_t row) const { return (sector<fNSectors[1]) ? fNPads[0][row]:fNPads[1][row];}
+ const Int_t * GetRowIndexes(Int_t sector) const {return (sector<fNSectors[1]) ? fRowPosIndex[0]:fRowPosIndex[1];}
+ //
+ //get sector parameters
+ //
+ Float_t GetInnerRadiusLow() const {return fInnerRadiusLow;}
+ Float_t GetInnerRadiusUp() const {return fInnerRadiusUp;}
+ Float_t GetOuterRadiusLow() const {return fOuterRadiusLow;}
+ Float_t GetOuterRadiusUp() const {return fOuterRadiusUp;}
+ Float_t GetInnerFrameSpace() const {return fInnerFrameSpace;}
+ Float_t GetOuterFrameSpace() const {return fOuterFrameSpace;}
+ Float_t GetInnerWireMount() const {return fInnerWireMount;}
+ Float_t GetOuterWireMount() const {return fOuterWireMount;}
+ Float_t GetInnerAngle() const {return fInnerAngle;}
+ Float_t GetOuterAngle() const {return fOuterAngle;}
+ Int_t GetNInnerSector() const {return fNSectors[0];}
+ Int_t GetNOuterSector() const {return fNSectors[1];}
+ Int_t GetNSector() const {return fNSectorsAll;}
+ Float_t GetZLength() const {return fZLength;}
+ //
+
+ protected:
+ //
+ // number of pads
+ //
+ void SetGeometry(); // set geometry parameters
+ Int_t fNSectorsAll; // number of sectors
+ Int_t fNSectors[2]; // number of sectors - inner outer
+ Int_t fNRows[2]; // number of row - inner outer
+ Int_t fNChannels[2]; // total number of pads - inner sector - outer sector
+ Int_t *fNPads[2]; // number of pads in row - inner - outer
+ Int_t *fRowPosIndex[2]; // index array - inner - outer
+ //
+ //
+ //---------------------------------------------------------------------
+ // ALICE TPC sector geometry
+ //--------------------------------------------------------------------
+ Float_t fInnerRadiusLow; // lower radius of inner sector-IP
+ Float_t fInnerRadiusUp; // upper radius of inner sector-IP
+ Float_t fOuterRadiusUp; // upper radius of outer sector-IP
+ Float_t fOuterRadiusLow; // lower radius of outer sector-IP
+ Float_t fInnerFrameSpace; //space for inner frame in the phi direction
+ Float_t fOuterFrameSpace; //space for outer frame in the phi direction
+ Float_t fInnerWireMount; //space for wire mount, inner sector
+ Float_t fOuterWireMount; //space for wire mount, outer sector
+ Float_t fZLength; //length of the drift region of the TPC
+ Float_t fInnerAngle; //angular coverage
+ Float_t fOuterAngle; //angular coverage
+ //
+ //---------------------------------------------------------------------
+ // ALICE TPC wires geometry - for GEM we can consider that it is gating
+ //--------------------------------------------------------------------
+ Int_t fNInnerWiresPerPad; //Number of wires per pad
+ Float_t fInnerWWPitch; //pitch between wires in inner sector - calculated
+ Int_t fInnerDummyWire; //number of wires without pad readout
+ Float_t fInnerOffWire; //oofset of first wire to the begining of the sector
+ Float_t fRInnerFirstWire; //position of the first wire -calculated
+ Float_t fRInnerLastWire; //position of the last wire -calculated
+ Float_t fLastWireUp1; //position of the last wire in outer1 sector
+ Int_t fNOuter1WiresPerPad; //Number of wires per pad
+ Int_t fNOuter2WiresPerPad; // Number of wires per pad
+ Float_t fOuterWWPitch; //pitch between wires in outer sector -calculated
+ Int_t fOuterDummyWire; //number of wires without pad readout
+ Float_t fOuterOffWire; //oofset of first wire to the begining of the sector
+ Float_t fROuterFirstWire; //position of the first wire -calulated
+ Float_t fROuterLastWire; //position of the last wire -calculated
+ //---------------------------------------------------------------------
+ // ALICE TPC pad parameters
+ //--------------------------------------------------------------------
+ Float_t fInnerPadPitchLength; //Inner pad pitch length
+ Float_t fInnerPadPitchWidth; //Inner pad pitch width
+ Float_t fInnerPadLength; //Inner pad length
+ Float_t fInnerPadWidth; //Inner pad width
+ Float_t fOuter1PadPitchLength; //Outer pad pitch length
+ Float_t fOuter2PadPitchLength; //Outer pad pitch length
+ Float_t fOuterPadPitchWidth; //Outer pad pitch width
+ Float_t fOuter1PadLength; //Outer pad length
+ Float_t fOuter2PadLength; //Outer pad length
+ Float_t fOuterPadWidth; //Outer pad width
+ //
+ Int_t fNRowLow; //number of pad rows per low sector -set
+ Int_t fNRowUp1; //number of short pad rows per sector up -set
+ Int_t fNRowUp2; //number of long pad rows per sector up -set
+ Int_t fNRowUp; //number of pad rows per sector up -calculated
+ Int_t fNtRows; //total number of rows in TPC -calculated
+ Float_t fPadRowLow[600]; //Lower sector, pad row radii -calculated
+ Float_t fPadRowUp[600]; //Upper sector, pad row radii -calculated
+ Int_t fNPadsLow[600]; //Lower sector, number of pads per row -calculated
+ Int_t fNPadsUp[600]; //Upper sector, number of pads per row -calculated
+ Float_t fYInner[600]; //Inner sector, wire-length
+ Float_t fYOuter[600]; //Outer sector, wire-length
+ protected:
+ static AliTPCROC* fgInstance; // Instance of this class (singleton implementation)
+ ClassDef(AliTPCROC,1) // TPC ROC class
+};
+
+#endif