#ifndef ALITPCPARAM_H #define ALITPCPARAM_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ //////////////////////////////////////////////// // Manager class for TPC parameters // //////////////////////////////////////////////// #include "AliDetectorParam.h" #include "TMath.h" #include class AliTPCParam : public AliDetectorParam { ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// //ALITPCParam object to be possible change //geometry and some other parameters of TPC //used by AliTPC and AliTPCSector public: AliTPCParam(); virtual ~AliTPCParam(); TGeoHMatrix * Tracking2LocalMatrix(const TGeoHMatrix * geoMatrix, Int_t sector) const; virtual Bool_t Transform(Float_t *xyz, Int_t *index, Int_t* oindex); //transformation from input coodination system to output coordination system Int_t Transform0to1(Float_t *xyz, Int_t *index) const; //trasforamtion from global to global - adjust index[0] sector //return value is equal to sector corresponding to global position void Transform1to2Ideal(Float_t *xyz, Int_t *index) const; //transformation to rotated coordinata - ideal frame void Transform1to2(Float_t *xyz, Int_t *index) const; //transformation to rotated coordinata void Transform2to1(Float_t *xyz, Int_t *index) const; //transformation from rotated coordinata to global coordinata void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const; //transform rotated coordinata of one sector to rotated //coordinata relative to another sector Float_t Transform2to2NearestWire(Float_t *xyz, Int_t *index) const; //round x position to nearest wire Int_t Transform2to3(Float_t *xyz, Int_t *index) const; //calulate coresponding index[2] -pad row for straight rows //does not change xyz[] //return pad - row void Transform3to4(Float_t *xyz, Int_t *index) const; //valid only for straight rows straight rows //calculate xyz[0] position relative to given index //return pad - row void Transform4to3(Float_t *xyz, Int_t *index) const; //valid only for straight rows straight rows //transform xyz[0] position relative to given index void Transform2to5( Float_t *xyz, Int_t *index) const; //transform [x,y,z] to [r,rphi,z] void Transform5to2(Float_t *xyz, Int_t *index) const; //transform [r,rphi,z] coordinata to [x,y,z] void Transform4to8(Float_t *xyz, Int_t *index) const; //transform xyz coordinata to 'digit' coordinata void Transform8to4(Float_t *xyz, Int_t *index) const; //transform 'digit' coordinata to xyz coordinata void Transform6to8(Float_t *xyz, Int_t *index) const; //transform dr,f coordinata to 'digit' coordinata void Transform8to6(Float_t *xyz, Int_t *index) const; //transform 'digit' coordinata to dr,f coordinata virtual Int_t Transform2toPadRow(Float_t */*xyz*/, Int_t */*index*/) const{return 0;} //transform rotated to virtual Int_t GetPadRow(Float_t *xyz, Int_t *index) const ; //return pad row of point xyz - xyz is given in coordinate system -(given by index) //output system is 3 for straight row and 7 for cylindrical row virtual void XYZtoCRXYZ(Float_t */*xyz*/, Int_t &/*sector*/, Int_t &/*padrow*/, Int_t /*option*/) const {;} //transform global position to the position relative to the sector padrow //if option=0 X calculate absolute calculate sector //if option=1 X absolute use input sector //if option=2 X relative to pad row calculate sector //if option=3 X relative use input sector virtual void CRXYZtoXYZ(Float_t */*xyz*/, const Int_t &/*sector*/, const Int_t & /*padrow*/, Int_t /*option*/) const {;} //transform relative position to the gloabal position virtual void CRTimePadtoYZ(Float_t &/*y*/, Float_t &/*z*/, const Float_t &/*time*/, const Float_t &/*pad*/, Int_t /*sector*/, Int_t /*padrow*/ ){;} //transform position in digit units (time slices and pads) to "normal" //units (cm) virtual void CRYZtoTimePad(const Float_t &/*y*/, const Float_t &/*z*/, Float_t &/*time*/, Float_t &/*pad*/, Int_t /*sector*/, Int_t /*padrow*/){;} //transform position in cm to position in digit unit virtual Int_t CalcResponse(Float_t* /*x*/, Int_t * /*index*/, Int_t /*row*/){return 0;} //calculate bin response as function of the input position -x and the weight //if row -pad row is equal -1 calculate response for each pad row //otherwise it calculate only in given pad row //return number of valid response bin virtual void SetDefault(); //set defaut TPCparam virtual Bool_t Update(); //recalculate and check geometric parameters virtual Bool_t ReadGeoMatrices(); //read geo matrixes Bool_t GetStatus() const; //get information about object consistency Int_t GetIndex(Int_t sector, Int_t row) const; //give index of the given sector and pad row Int_t GetNSegmentsTotal() const {return fNtRows;} Double_t GetLowMaxY(Int_t irow) const {return irow*0.;} Double_t GetUpMaxY(Int_t irow) const {return irow*0;} //additional geometrical function - for Belikov Bool_t AdjustSectorRow(Int_t index, Int_t & sector, Int_t &row) const; //return sector and padrow //for given index void AdjustCosSin(Int_t isec, Float_t &cos, Float_t &sin) const; //set cosinus and sinus of rotation angles for sector isec Float_t GetAngle(Int_t isec) const; // void GetChamberPos(Int_t isec, Float_t* xyz) const; // void GetChamberRot(Int_t isec, Float_t* angles) const; // //set sector parameters // void SetInnerRadiusLow(Float_t InnerRadiusLow ) { fInnerRadiusLow=InnerRadiusLow;} void SetOuterRadiusLow(Float_t OuterRadiusLow ) { fOuterRadiusLow=OuterRadiusLow;} void SetInnerRadiusUp(Float_t InnerRadiusUp) { fInnerRadiusUp= InnerRadiusUp;} void SetOuterRadiusUp(Float_t OuterRadiusUp) { fOuterRadiusUp= OuterRadiusUp;} void SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle, Float_t outershift); void SetInnerFrameSpace(Float_t frspace) {fInnerFrameSpace = frspace;} void SetOuterFrameSpace(Float_t frspace) {fOuterFrameSpace = frspace;} void SetInnerWireMount(Float_t fmount) {fInnerWireMount = fmount;} void SetOuterWireMount(Float_t fmount) {fOuterWireMount = fmount;} void SetZLength(Float_t zlength) {fZLength = zlength;} void SetGeometryType(Int_t type) {fGeometryType = type;} // // pad rows geometry // void SetRowNLow( Int_t NRowLow){fNRowLow = NRowLow;} void SetRowNUp1 (Int_t NRowUp1){fNRowUp1 = NRowUp1 ;} //upper sec short pads void SetRowNUp2 (Int_t NRowUp2){fNRowUp2 = NRowUp2 ;} //upper sec long pads void SetRowNUp (Int_t NRowUp){fNRowUp = NRowUp ;} // //set wire parameters // void SetInnerNWires(Int_t nWires){ fNInnerWiresPerPad=nWires;} void SetInnerDummyWire(Int_t dummy) {fInnerDummyWire = dummy;} void SetInnerOffWire(Float_t offset) {fInnerOffWire =offset;} void SetOuter1NWires(Int_t nWires){ fNOuter1WiresPerPad=nWires;} void SetOuter2NWire(Int_t nWires){ fNOuter2WiresPerPad=nWires;} void SetOuterDummyWire(Int_t dummy) {fOuterDummyWire = dummy;} void SetOuterOffWire(Float_t offset) {fOuterOffWire =offset;} void SetInnerWWPitch( Float_t wwPitch) {fInnerWWPitch = wwPitch;} void SetRInnerFirstWire(Float_t firstWire){fRInnerFirstWire = firstWire;} void SetRInnerLastWire(Float_t lastWire){fRInnerLastWire = lastWire;} void SetOuterWWPitch(Float_t wwPitch){fOuterWWPitch = wwPitch;} void SetLastWireUp1(Float_t wireUp1){fLastWireUp1 = wireUp1;} void SetROuterFirstWire(Float_t firstWire){fROuterFirstWire = firstWire;} void SetROuterLastWire(Float_t lastWire){fROuterLastWire = lastWire;} // //set pad parameter // void SetInnerPadPitchLength(Float_t PadPitchLength){ fInnerPadPitchLength=PadPitchLength;} void SetInnerPadPitchWidth(Float_t PadPitchWidth){ fInnerPadPitchWidth = PadPitchWidth;} void SetInnerPadLength(Float_t PadLength){ fInnerPadLength=PadLength;} void SetInnerPadWidth(Float_t PadWidth) { fInnerPadWidth=PadWidth;} void SetOuter1PadPitchLength(Float_t PadPitchLength){ fOuter1PadPitchLength=PadPitchLength;} void SetOuter2PadPitchLength(Float_t PadPitchLength){ fOuter2PadPitchLength=PadPitchLength;} void SetOuterPadPitchWidth(Float_t PadPitchWidth){ fOuterPadPitchWidth = PadPitchWidth;} void SetOuter1PadLength(Float_t PadLength){ fOuter1PadLength=PadLength;} void SetOuter2PadLength(Float_t PadLength){ fOuter2PadLength=PadLength;} void SetOuterPadWidth(Float_t PadWidth) { fOuterPadWidth=PadWidth;} void SetMWPCReadout(Bool_t type) {fBMWPCReadout = type;} void SetNCrossRows(Int_t rows){fNCrossRows = rows;} // //set gas paremeters // void SetDiffT(Float_t DiffT){ fDiffT= DiffT;} void SetDiffL(Float_t DiffL){ fDiffL=DiffL;} void SetGasGain(Float_t GasGain){ fGasGain=GasGain;} void SetDriftV(Float_t DriftV){ fDriftV= DriftV;} void SetOmegaTau(Float_t OmegaTau){ fOmegaTau=OmegaTau;} void SetAttCoef(Float_t AttCoef){ fAttCoef=AttCoef;} void SetOxyCont(Float_t OxyCont){ fOxyCont=OxyCont;} // //set electronivc parameters // void SetPadCoupling(Float_t PadCoupling){ fPadCoupling=PadCoupling;} void SetZeroSup(Int_t ZeroSup) { fZeroSup=ZeroSup;} void SetNoise(Float_t Noise ) { fNoise= Noise;} void SetChipGain(Float_t ChipGain){ fChipGain= ChipGain;} void SetChipNorm(Float_t ChipNorm){ fChipNorm= ChipNorm;} void SetTSample(Float_t TSample) { fTSample=TSample;} void SetTFWHM(Float_t fwhm) { fTSigma=fwhm/2.35;} void SetMaxTBin(Int_t maxtbin) { fMaxTBin = maxtbin;} void SetADCSat(Int_t adcsat) { fADCSat = adcsat;} void SetADCDynRange(Float_t adcdynrange) {fADCDynRange = adcdynrange;} // //set response parameters // void SetNResponseMax(Int_t max) { fNResponseMax = max;} void SetResponseThreshold(Int_t threshold) {fResponseThreshold = threshold;} //set L1 parameters void SetGateDelay(Float_t delay) {fGateDelay = delay;} void SetL1Delay(Float_t delay) {fL1Delay = delay;} void SetNTBinsBeforeL1(UShort_t nbins) {fNTBinsBeforeL1 = nbins;} // //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 ; Float_t GetInnerAngleShift() const ; Float_t GetOuterAngle() const ; Float_t GetOuterAngleShift() const ; Int_t GetNInnerSector() const {return fNInnerSector;} Int_t GetNOuterSector() const {return fNOuterSector;} Int_t GetNSector() const {return fNSector;} Float_t GetZLength(Int_t sector=0) const; Int_t GetGeometryType() const {return fGeometryType;} // //get wires parameter // Int_t GetInnerNWires() const {return fNInnerWiresPerPad;} Float_t GetInnerWWPitch() const {return fInnerWWPitch;} Int_t GetInnerDummyWire() const {return fInnerDummyWire;} Float_t GetInnerOffWire() const {return fInnerOffWire;} Float_t GetRInnerFirstWire() const {return fRInnerFirstWire;} Float_t GetRInnerLastWire() const {return fRInnerLastWire;} Int_t GetOuter1NWires() const {return fNOuter1WiresPerPad;} Int_t GetOuter2NWires() const {return fNOuter2WiresPerPad;} Float_t GetOuterWWPitch() const {return fOuterWWPitch;} Int_t GetOuterDummyWire() const {return fOuterDummyWire;} Float_t GetOuterOffWire() const {return fOuterOffWire;} Float_t GetLastWireUp1() const {return fLastWireUp1;} Float_t GetROuterFirstWire() const {return fROuterFirstWire;} Float_t GetROuterLastWire() const {return fROuterLastWire;} Float_t GetWWPitch(Int_t isector = 0) const { return ( (isector < fNInnerSector) ? fInnerWWPitch :fOuterWWPitch);} // //get pad parameters // Float_t GetInnerPadPitchLength() const {return fInnerPadPitchLength;} Float_t GetInnerPadPitchWidth() const {return fInnerPadPitchWidth;} Float_t GetInnerPadLength() const {return fInnerPadLength;} Float_t GetInnerPadWidth() const {return fInnerPadWidth;} Float_t GetOuter1PadPitchLength() const {return fOuter1PadPitchLength;} Float_t GetOuter2PadPitchLength() const {return fOuter2PadPitchLength;} Float_t GetOuterPadPitchWidth() const {return fOuterPadPitchWidth;} Float_t GetOuter1PadLength() const {return fOuter1PadLength;} Float_t GetOuter2PadLength() const {return fOuter2PadLength;} Float_t GetOuterPadWidth() const {return fOuterPadWidth;} Bool_t GetMWPCReadout() const {return fBMWPCReadout;} Int_t GetNCrossRows() const {return fNCrossRows;} Float_t GetPadPitchWidth(Int_t isector = 0) const { return ( (isector < fNInnerSector) ? fInnerPadPitchWidth :fOuterPadPitchWidth);} Float_t GetPadPitchLength(Int_t isector = 0, Int_t padrow=0) const { if (isector < fNInnerSector) return fInnerPadPitchLength; else return ((padrowMasterToLocal(xyzmaster,xyzlocal); xyz[0] = xyzlocal[0]; xyz[1] = xyzlocal[1]; xyz[2] = xyzlocal[2]; index[0]=2; } inline void AliTPCParam::Transform2to1(Float_t *xyz, Int_t *index) const { // //transformation from rotated coordinates to global coordinates // Float_t cos,sin; AdjustCosSin(index[1],cos,sin); Float_t x1=xyz[0]*cos - xyz[1]*sin; Float_t y1=xyz[0]*sin + xyz[1]*cos; xyz[0]=x1; xyz[1]=y1; xyz[2]=fZLength-xyz[2]; if (index[1]=(fNInnerSector>>1)) xyz[2]*=-1.; else if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[2]*=-1; index[0]=1; } inline void AliTPCParam::Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const { //transform rotated coordinats of one sector to rotated //coordinates relative to another sector Transform2to1(xyz,index); Transform1to2(xyz,oindex); index[0]=2; index[1]=oindex[1]; } inline Float_t AliTPCParam::Transform2to2NearestWire(Float_t *xyz, Int_t *index) const { // // asigns the x-position of the closest wire to xyz[0], return the // electron to closest wire distance // Float_t xnew,dx; if (index[1]0) && (xyz[1]<0) ) angle=2*TMath::Pi()+angle; } xyz[0]=r; xyz[1]=angle; index[0]=5; } inline void AliTPCParam::Transform5to2( Float_t *xyz, Int_t *index) const { // //transform [r,rphi,z] to [x,y,z] // Float_t r = xyz[0]; Float_t angle= xyz[1]; xyz[0]=r*TMath::Cos(angle); xyz[1]=r*TMath::Sin(angle); index[0]=2; } inline void AliTPCParam::Transform4to8(Float_t *xyz, Int_t *index) const { // //transform xyz coordinates to 'digit' coordinates // xyz[2]/=fZWidth; if (index[1]35&§or<54)) return fZLength-0.275; else return fZLength-0.302; } #endif