+//Calculate the HV sector corresponding to the cluster position
+//Arguments: y
+//Returns the HV sector in the single module
+
+ Int_t hvsec = -1;
+ Int_t pc,px,py;
+ Lors2Pad(1.,y,pc,px,py);
+ if(py==-1) return hvsec;
+
+ hvsec = (py+(pc/2)*(kMaxPy+1))/((kMaxPy+1)/2);
+
+ return hvsec;
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Double_t AliHMPIDParam::FindTemp(Double_t tLow,Double_t tHigh,Double_t y)
+{
+// Model for gradient in temperature
+ Double_t yRad = HinRad(y); //height in a given radiator
+ if(tHigh<tLow) tHigh = tLow; //if Tout < Tin consider just Tin as reference...
+ if(yRad<0 ) yRad = 0; //protection against fake y values
+ if(yRad>SizePcY()) yRad = SizePcY(); //protection against fake y values
+
+ Double_t gradT = (tHigh-tLow)/SizePcY(); // linear gradient
+ return gradT*yRad+tLow;
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDParam::SetChStatus(Int_t ch,Bool_t status)
+{
+//Set a chamber on or off depending on the status
+//Arguments: ch=chamber,status=kTRUE = active, kFALSE=off
+//Returns: none
+ for(Int_t padx=0;padx<kMaxPcx+1;padx++) {
+ for(Int_t pady=0;pady<kMaxPcy+1;pady++) {
+ fgMapPad[padx][pady][ch] = status;
+ }
+ }
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDParam::SetSectStatus(Int_t ch,Int_t sect,Bool_t status)
+{
+//Set a given sector sect for a chamber ch on or off depending on the status
+//Sector=0,5 (6 sectors)
+//Arguments: ch=chamber,sect=sector,status: kTRUE = active, kFALSE=off
+//Returns: none
+
+ Int_t npadsect = (kMaxPcy+1)/6;
+ Int_t padSectMin = npadsect*sect;
+ Int_t padSectMax = padSectMin+npadsect;
+
+ for(Int_t padx=0;padx<kMaxPcx+1;padx++) {
+ for(Int_t pady=padSectMin;pady<padSectMax;pady++) {
+ fgMapPad[padx][pady][ch] = status;
+ }
+ }
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDParam::SetPcStatus(Int_t ch,Int_t pc,Bool_t status)
+{
+//Set a given PC pc for a chamber ch on or off depending on the status
+//Arguments: ch=chamber,pc=PC,status: kTRUE = active, kFALSE=off
+//Returns: none
+
+ Int_t deltaX = pc%2;
+ Int_t deltaY = pc/2;
+ Int_t padPcXMin = deltaX*kPadPcX;
+ Int_t padPcXMax = padPcXMin+kPadPcX;
+ Int_t padPcYMin = deltaY*kPadPcY;
+ Int_t padPcYMax = padPcYMin+kPadPcY;
+
+ for(Int_t padx=padPcXMin;padx<padPcXMax;padx++) {
+ for(Int_t pady=padPcYMin;pady<padPcYMax;pady++) {
+ fgMapPad[padx][pady][ch] = status;
+ }
+ }
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void AliHMPIDParam::PrintChStatus(Int_t ch)
+{
+//Print the map status of a chamber on or off depending on the status
+//Arguments: ch=chamber
+//Returns: none
+ Printf(" ");
+ Printf(" --------- C H A M B E R %d ---------------",ch);
+ for(Int_t pady=kMaxPcy;pady>=0;pady--) {
+ for(Int_t padx=0;padx<kMaxPcx+1;padx++) {
+ if(padx==80) printf(" ");
+ printf("%d",fgMapPad[padx][pady][ch]);
+ }
+ printf(" %d \n",pady+1);
+ if(pady%48==0) printf("\n");
+ }
+ printf("\n");