ROOT logo
/***************************************************************************
 * 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.                  *
 **************************************************************************/

/*
 $Id$
*/


/////////////////////////////////////////////////////////////////////
// Base simulation functions for ITS                               //
//                                                                 //
//                                                                 //
/////////////////////////////////////////////////////////////////////          
#include "TBranch.h"
#include "TClonesArray.h"
#include "TObjArray.h"
#include "TTree.h"

#include "AliRun.h"

#include "AliCDBManager.h"
#include "AliCDBId.h"
#include "AliCDBStorage.h"
#include "AliCDBEntry.h"
#include "AliCDBMetaData.h"
#include "AliITSdigit.h"
#include "AliITSdigitSPD.h"
#include "AliITSdigitSDD.h"
#include "AliITSdigitSSD.h"
#include "AliITSgeom.h"
#include "AliITSDetTypeSim.h"
#include "AliITSpListItem.h"
#include "AliITSCalibration.h"
#include "AliITSCalibrationSDD.h"
#include "AliITSMapSDD.h"
#include "AliITSCorrMapSDD.h"
#include "AliITSDriftSpeedArraySDD.h"
#include "AliITSDriftSpeedSDD.h"
#include "AliITSCalibrationSSD.h"
#include "AliITSNoiseSSDv2.h"
#include "AliITSGainSSDv2.h"
#include "AliITSBadChannelsSSDv2.h"
#include "AliITSNoiseSSD.h"
#include "AliITSGainSSD.h"
#include "AliITSBadChannelsSSD.h"
#include "AliITSCalibrationSSD.h"
#include "AliITSsegmentationSPD.h"
#include "AliITSsegmentationSDD.h"
#include "AliITSsegmentationSSD.h"
#include "AliITSsimulation.h"
#include "AliITSsimulationSPD.h"
#include "AliITSsimulationSDD.h"
#include "AliITSsimulationSSD.h"
#include "AliITSresponseSDD.h"
#include "AliITSDDLModuleMapSDD.h"
#include "AliITSTriggerConditions.h"
#include "AliBaseLoader.h"

const Int_t AliITSDetTypeSim::fgkNdettypes = 3;
const Int_t AliITSDetTypeSim::fgkDefaultNModulesSPD =  240;
const Int_t AliITSDetTypeSim::fgkDefaultNModulesSDD =  260;
const Int_t AliITSDetTypeSim::fgkDefaultNModulesSSD = 1698;

using std::endl;
using std::cout;
ClassImp(AliITSDetTypeSim)

//----------------------------------------------------------------------
AliITSDetTypeSim::AliITSDetTypeSim():
TObject(),
fSimulation(),   // [NDet]
fSegmentation(), // [NDet]
fCalibration(),     // [NMod]
fSSDCalibration(0),
fSPDNoisy(0),
fSPDSparseDead(0),
fNSDigits(0),    //! number of SDigits
fSDigits("AliITSpListItem",1000),   
fNDigits(0),     //! number of Digits
fRunNumber(0),   //! Run number (to access DB)
fDigits(),       //! [NMod][NDigits]
fSimuPar(0),
fDDLMapSDD(0),
fRespSDD(0),
fAveGainSDD(0),
fkDigClassName(), // String with digit class name.
fLoader(0),      // local pointer to loader
fFirstcall(kTRUE),
fFOGenerator(),
fTriggerConditions(NULL)
{ 
    // Default Constructor
    // Inputs:
    //    none.
    // Outputs:
    //    none.
    // Return:
    //    A properly zero-ed AliITSDetTypeSim class.

  fSimulation = new TObjArray(fgkNdettypes);
  fSegmentation = new TObjArray(fgkNdettypes);
  fSegmentation->SetOwner(kTRUE);
  fDigits = new TObjArray(fgkNdettypes);
  fNDigits = new Int_t[fgkNdettypes];
  fDDLMapSDD=new AliITSDDLModuleMapSDD();
  fSimuPar= new AliITSSimuParam();
  fSSDCalibration=new AliITSCalibrationSSD();
  SetRunNumber();
}
//----------------------------------------------------------------------
AliITSDetTypeSim::~AliITSDetTypeSim(){
    // Destructor
    // Inputs:
    //    none.
    // Outputs:
    //    none.
    // Return:
    //    Nothing.

    if(fSimulation){
	fSimulation->Delete();
	delete fSimulation;
    }
    fSimulation = 0;
    if(fSegmentation){
	fSegmentation->Delete();
	delete fSegmentation;
    }
    fSegmentation = 0;
    if(fCalibration && fRunNumber<0){

	fCalibration->Delete();
	delete fCalibration;
    }
    fCalibration = 0;
    if(fSSDCalibration) {
      if(!(AliCDBManager::Instance()->GetCacheFlag())) {
	delete fSSDCalibration;
	fSSDCalibration = NULL;
      }
    }
    if(fSPDNoisy){
    if(!(AliCDBManager::Instance()->GetCacheFlag())) {
       fSPDNoisy->Delete();
       delete fSPDNoisy;
       fSPDNoisy = 0;
      }
    }
    if(fSPDSparseDead){
    if(!(AliCDBManager::Instance()->GetCacheFlag())) {
       fSPDSparseDead->Delete();
       delete fSPDSparseDead;
       fSPDSparseDead = 0;
      }
    }
    if(fSimuPar) delete fSimuPar;
    if(fRespSDD){
      if(!(AliCDBManager::Instance()->GetCacheFlag())){
	delete fRespSDD;
	fRespSDD=0;
      }
    }
    if(fDDLMapSDD) delete fDDLMapSDD;
    if(fNDigits) delete [] fNDigits;
    fNDigits = 0;
    if (fLoader)fLoader->GetModulesFolder()->Remove(this);
    fLoader = 0; // Not deleting it.
    fSDigits.Delete();
    if (fDigits) {
      fDigits->Delete();
      delete fDigits;
    }
    fDigits=0;
}
//----------------------------------------------------------------------
// AliITSDetTypeSim::AliITSDetTypeSim(const AliITSDetTypeSim &source) : TObject(source),
// fSimulation(source.fSimulation),   // [NDet]
// fSegmentation(source.fSegmentation), // [NDet]
// fCalibration(source.fCalibration),     // [NMod]
// fSSDCalibration(source.fSSDCalibration),
// fSPDNoisy(source.fSPDNoisy),
// fSPDSparseDead(source.fSPDSparseDead),
// fNSDigits(source.fNSDigits),    //! number of SDigits
// fSDigits(*((TClonesArray*)source.fSDigits.Clone())),
// fNDigits(source.fNDigits),     //! number of Digits
// fRunNumber(source.fRunNumber),   //! Run number (to access DB)
// fDigits(source.fDigits),       //! [NMod][NDigits]
// fSimuPar(source.fSimuPar),
// fDDLMapSDD(source.fDDLMapSDD),
// fRespSDD(source.fRespSDD),
// fAveGainSDD(source.fAveGainSDD),
// fkDigClassName(), // String with digit class name.
// fLoader(source.fLoader),      // local pointer to loader
// fFirstcall(source.fFirstcall),
// fFOGenerator(source.fFOGenerator),
// fTriggerConditions(source.fTriggerConditions) 
// {
//     // Copy Constructor for object AliITSDetTypeSim not allowed
//   for(Int_t i=0;i<fgkNdettypes;i++){
//     fkDigClassName[i] = source.fkDigClassName[i];
//   }
// }
// //----------------------------------------------------------------------
// AliITSDetTypeSim& AliITSDetTypeSim::operator=(const AliITSDetTypeSim &source){
//     // The = operator for object AliITSDetTypeSim
 
//   this->~AliITSDetTypeSim();
//   new(this) AliITSDetTypeSim(source);
//   return *this;
// }

//______________________________________________________________________
void AliITSDetTypeSim::SetITSgeom(AliITSgeom *geom){
    // Sets/replaces the existing AliITSgeom object kept in AliITSLoader
    // 
    // Inputs:
    //   AliITSgoem   *geom  The AliITSgeom object to be used.
    // Output:
    //   none.
    // Return:
    //   none.
  if(!fLoader){
    Error("SetITSgeom","No pointer to loader - nothing done");
    return;
  }
  else {
    fLoader->SetITSgeom(geom);  // protections in AliITSLoader::SetITSgeom
  }
 
}
//______________________________________________________________________
void AliITSDetTypeSim::SetLoader(AliITSLoader *loader){
    // Sets the local copy of the AliITSLoader, and passes on the
    // AliITSgeom object as needed.
    // Inputs
    //   AliITSLoader  *loader pointer to AliITSLoader for local use
    // Outputs:
    //   none.
    // Return:
    //  none.

    if(fLoader==loader) return; // Same do nothing
    if(fLoader){ // alread have an existing loader
	Error("SetLoader",
		"Already have an exisiting loader ptr=%p Nothing done",
		fLoader);
    } // end if
    fLoader = loader;
}
//______________________________________________________________________
void AliITSDetTypeSim::SetSimulationModel(Int_t dettype,AliITSsimulation *sim){

  //Set simulation model for detector type

  if(fSimulation==0) fSimulation = new TObjArray(fgkNdettypes);
  fSimulation->AddAt(sim,dettype);
}
//______________________________________________________________________
AliITSsimulation* AliITSDetTypeSim::GetSimulationModel(Int_t dettype) const { 

  //Get simulation model for detector type
  if(fSimulation==0)  {
    Warning("GetSimulationModel","fSimulation is 0!");
    return 0;     
  }
  return (AliITSsimulation*)(fSimulation->At(dettype));
}
//______________________________________________________________________
AliITSsimulation* AliITSDetTypeSim::GetSimulationModelByModule(Int_t module) const {

  //Get simulation model by module number
  if(GetITSgeom()==0) {
    Warning("GetSimulationModelByModule","GetITSgeom() is 0!");
    return 0;
  }
  
  return GetSimulationModel(GetITSgeom()->GetModuleType(module));
}
//_______________________________________________________________________
void AliITSDetTypeSim::SetDefaultSegmentation(Int_t idet){
    // Set default segmentation model objects
    AliITSsegmentation *seg;

    if(fSegmentation==0x0){
	fSegmentation = new TObjArray(fgkNdettypes);
	fSegmentation->SetOwner(kTRUE);
    }
    if(GetSegmentationModel(idet))
	delete (AliITSsegmentation*)fSegmentation->At(idet);
    if(idet==0){
	seg = new AliITSsegmentationSPD();
    }else if(idet==1){
      seg = new AliITSsegmentationSDD();
      AliITSCalibrationSDD* cal=(AliITSCalibrationSDD*)GetCalibrationModel(fgkDefaultNModulesSPD+1);
      if(cal->IsAMAt20MHz()){ 
	seg->SetPadSize(seg->Dpz(0),20.);
	seg->SetNPads(seg->Npz()/2,128);
      }
    }else {
	seg = new AliITSsegmentationSSD();
    }
    SetSegmentationModel(idet,seg);
}
//______________________________________________________________________
void AliITSDetTypeSim::SetSegmentationModel(Int_t dettype,
					    AliITSsegmentation *seg){
   
  //Set segmentation model for detector type
  if(fSegmentation==0x0){
    fSegmentation = new TObjArray(fgkNdettypes);
    fSegmentation->SetOwner(kTRUE);
  }
  fSegmentation->AddAt(seg,dettype);
}
//______________________________________________________________________
AliITSsegmentation* AliITSDetTypeSim::GetSegmentationModel(Int_t dettype) const{
  //Get segmentation model for detector type
   
   if(fSegmentation==0) {
       Warning("GetSegmentationModel","fSegmentation is 0!");
       return 0; 
   } 
   return (AliITSsegmentation*)(fSegmentation->At(dettype));
}
//_______________________________________________________________________
AliITSsegmentation* AliITSDetTypeSim::GetSegmentationModelByModule(Int_t module) const{
    //Get segmentation model by module number
    if(GetITSgeom()==0){
	Warning("GetSegmentationModelByModule","GetITSgeom() is 0!");
	return 0;
    }     
    return GetSegmentationModel(GetITSgeom()->GetModuleType(module));
}
//_______________________________________________________________________
void AliITSDetTypeSim::CreateCalibrationArray() {
    //Create the container of calibration functions with correct size
    if (fCalibration) {
	Warning("CreateCalibration","pointer to calibration object exists\n");
	fCalibration->Delete();
	delete fCalibration;
    }

    Int_t nModTot = GetITSgeom()->GetIndexMax();
    fCalibration = new TObjArray(nModTot);
    fCalibration->SetOwner(kTRUE);
    fCalibration->Clear();
}
//_______________________________________________________________________
void AliITSDetTypeSim::SetCalibrationModel(Int_t iMod, AliITSCalibration *resp){
    //Set response model for modules

    if (fCalibration==0) CreateCalibrationArray();
 
    if (fCalibration->At(iMod)!=0)
	delete (AliITSCalibration*) fCalibration->At(iMod);
    fCalibration->AddAt(resp, iMod);
}
//_______________________________________________________________________
void AliITSDetTypeSim::SetSPDNoisyModel(Int_t iMod, AliITSCalibration *cal){
  //Set noisy pixel info for the SPD module iMod
  if (fSPDNoisy==0) {
    fSPDNoisy = new TObjArray(fgkDefaultNModulesSPD);
    fSPDNoisy->SetOwner(kTRUE);
    fSPDNoisy->Clear();
  }

  if (fSPDNoisy->At(iMod) != 0)
    delete (AliITSCalibration*) fSPDNoisy->At(iMod);
  fSPDNoisy->AddAt(cal,iMod);
}
//_______________________________________________________________________
void AliITSDetTypeSim::SetSPDSparseDeadModel(Int_t iMod, AliITSCalibration *cal){
  //Set sparse dead pixel info for the SPD module iMod
  if (fSPDSparseDead==0) {
    fSPDSparseDead = new TObjArray(fgkDefaultNModulesSPD);
    fSPDSparseDead->SetOwner(kTRUE);
    fSPDSparseDead->Clear();
  }

  if (fSPDNoisy->At(iMod) != 0)
    delete (AliITSCalibration*) fSPDNoisy->At(iMod);
  fSPDNoisy->AddAt(cal,iMod);
}
//______________________________________________________________________
void AliITSDetTypeSim::ResetCalibrationArray(){
    //resets response array
    if(fCalibration && fRunNumber<0){  // if fRunNumber<0 fCalibration is owner
      /*
	AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(
                                GetITSgeom()->GetStartSPD()))->GetResponse();
	AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(
                                GetITSgeom()->GetStartSSD()))->GetResponse();
	if(rspd) delete rspd;
	if(rssd) delete rssd;
      */
	fCalibration->Clear();
    }else if (fCalibration && fRunNumber>=0){
	fCalibration->Clear();
    }
}
//______________________________________________________________________
void AliITSDetTypeSim::ResetSegmentation(){
    //Resets segmentation array
    if(fSegmentation) fSegmentation->Clear();
}
//_______________________________________________________________________
AliITSCalibration* AliITSDetTypeSim::GetCalibrationModel(Int_t iMod) const {
    //Get response model for module number iMod 
 
    if(fCalibration==0) {
	AliError("fCalibration is 0!");
	return 0; 
    }
  if(iMod<fgkDefaultNModulesSPD+fgkDefaultNModulesSDD){
    return (AliITSCalibration*)fCalibration->At(iMod);
  }else{
    Int_t i=iMod-(fgkDefaultNModulesSPD+fgkDefaultNModulesSDD);
    fSSDCalibration->SetModule(i);
    return (AliITSCalibration*)fSSDCalibration;
  }

}
//_______________________________________________________________________
AliITSCalibration* AliITSDetTypeSim::GetSPDNoisyModel(Int_t iMod) const {
  //Get SPD noisy calib for module iMod 
  if(fSPDNoisy==0) {
    AliWarning("fSPDNoisy is 0!");
    return 0; 
  }
  return (AliITSCalibration*)fSPDNoisy->At(iMod);
}
//_______________________________________________________________________
void AliITSDetTypeSim::SetDefaults(){
    //Set defaults for segmentation and response

    if(GetITSgeom()==0){
	Warning("SetDefaults","GetITSgeom() is 0!");
	return;
    } // end if
    if (fCalibration==0) {
	CreateCalibrationArray();
    } // end if

    ResetSegmentation();
    if(!GetCalibration()){AliFatal("Exit"); exit(0);}

    SetDigitClassName(0,"AliITSdigitSPD");
    SetDigitClassName(1,"AliITSdigitSDD");
    SetDigitClassName(2,"AliITSdigitSSD");

    for(Int_t idet=0;idet<fgkNdettypes;idet++){
      if(!GetSegmentationModel(idet)) SetDefaultSegmentation(idet);
    }
}
//______________________________________________________________________
Bool_t AliITSDetTypeSim::GetCalibration() {
  // Get Default calibration if a storage is not defined.

  if(!fFirstcall){
    AliITSCalibration* cal = GetCalibrationModel(0);
    if(cal)return kTRUE;
  }
  else {
    fFirstcall = kFALSE;
  }

  SetRunNumber((Int_t)AliCDBManager::Instance()->GetRun());
  Int_t run=GetRunNumber();

  Bool_t origCacheStatus = AliCDBManager::Instance()->GetCacheFlag();
  Bool_t isCacheActive = kTRUE;
  if(GetRunNumber()<0){
    isCacheActive=kFALSE;
    fCalibration->SetOwner(kTRUE);
  }
  else{
    fCalibration->SetOwner(kFALSE);
  }

  AliCDBManager::Instance()->SetCacheFlag(isCacheActive);

  AliCDBEntry *deadSPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDDead", run);
  AliCDBEntry *noisySPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDNoisy", run);
  AliCDBEntry *foEffSPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDFOEfficiency", run);
  AliCDBEntry *foNoiSPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDFONoise", run);
  AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD", run);
  AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD");
  AliCDBEntry *drSpSDD = AliCDBManager::Instance()->Get("ITS/Calib/DriftSpeedSDD",run);
  AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD",run);
  //AliCDBEntry *mapASDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsAnodeSDD",run);
  AliCDBEntry *mapTSDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsTimeSDD",run);
  // AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD", run);
  AliCDBEntry *entryNoiseSSD = AliCDBManager::Instance()->Get("ITS/Calib/NoiseSSD");
  AliCDBEntry *entryGainSSD = AliCDBManager::Instance()->Get("ITS/Calib/GainSSD");
  AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD");

if(!deadSPD || !noisySPD || !foEffSPD || !foNoiSPD 
     || !entrySDD  || !entry2SDD || !entryNoiseSSD || !entryGainSSD || !entryBadChannelsSSD 
     || !drSpSDD || !ddlMapSDD || !mapTSDD){
    AliFatal("Calibration object retrieval failed! ");
    return kFALSE;
  }  	  	
	

  TObjArray *calDeadSPD = (TObjArray*) deadSPD->GetObject();
  if (!isCacheActive) deadSPD->SetObject(NULL);
  deadSPD->SetOwner(kTRUE);

  TObjArray *calNoisySPD = (TObjArray*) noisySPD->GetObject();
  if (!isCacheActive) noisySPD->SetObject(NULL);
  noisySPD->SetOwner(kTRUE);

  AliITSFOEfficiencySPD *calFoEffSPD = (AliITSFOEfficiencySPD*) foEffSPD->GetObject();
  if (!isCacheActive) foEffSPD->SetObject(NULL);
  foEffSPD->SetOwner(kTRUE);

  AliITSFONoiseSPD *calFoNoiSPD = (AliITSFONoiseSPD*) foNoiSPD->GetObject();
  if (!isCacheActive) foNoiSPD->SetObject(NULL);
  foNoiSPD->SetOwner(kTRUE);
   
  TObjArray *calSDD = (TObjArray *)entrySDD->GetObject();
  if(!isCacheActive)entrySDD->SetObject(NULL);
  entrySDD->SetOwner(kTRUE);

  AliITSresponseSDD *pSDD = (AliITSresponseSDD*)entry2SDD->GetObject();
  if(!isCacheActive)entry2SDD->SetObject(NULL);
  entry2SDD->SetOwner(kTRUE);

  TObjArray *drSp = (TObjArray *)drSpSDD->GetObject();
  if(!isCacheActive)drSpSDD->SetObject(NULL);
  drSpSDD->SetOwner(kTRUE);

  AliITSDDLModuleMapSDD *ddlsdd=(AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject();
  if(!isCacheActive)ddlMapSDD->SetObject(NULL);
  ddlMapSDD->SetOwner(kTRUE);

//   TObjArray *mapAn = (TObjArray *)mapASDD->GetObject();
//   if(!isCacheActive)mapASDD->SetObject(NULL);
//   mapASDD->SetOwner(kTRUE);

  TObjArray *mapT = (TObjArray *)mapTSDD->GetObject();
  if(!isCacheActive)mapTSDD->SetObject(NULL);
  mapTSDD->SetOwner(kTRUE);

  /*
  TObjArray *calSSD = (TObjArray *)entrySSD->GetObject();
  if(!isCacheActive)entrySSD->SetObject(NULL);
  entrySSD->SetOwner(kTRUE);
  */

  TObject *emptyssd = 0; TString ssdobjectname;
  AliITSNoiseSSDv2 *noiseSSD = NULL; 
  emptyssd = (TObject *)entryNoiseSSD->GetObject();
  ssdobjectname = emptyssd->GetName();
  if(ssdobjectname=="TObjArray") {
    noiseSSD = new AliITSNoiseSSDv2(); 
    TObjArray *noiseSSDOld = (TObjArray *)entryNoiseSSD->GetObject();
    ReadOldSSDNoise(noiseSSDOld, noiseSSD);
  }
  else if(ssdobjectname=="AliITSNoiseSSDv2")
    noiseSSD = (AliITSNoiseSSDv2 *)entryNoiseSSD->GetObject();
  if(!isCacheActive)entryNoiseSSD->SetObject(NULL);
  entryNoiseSSD->SetOwner(kTRUE);

  AliITSGainSSDv2 *gainSSD = NULL;
  emptyssd = (TObject *)entryGainSSD->GetObject();
  ssdobjectname = emptyssd->GetName();
  if(ssdobjectname=="Gain") {
    TObjArray *gainSSDOld = (TObjArray *)entryGainSSD->GetObject();
    gainSSD = new AliITSGainSSDv2();
    ReadOldSSDGain(gainSSDOld, gainSSD);
  }
  else if(ssdobjectname=="AliITSGainSSDv2")
    gainSSD = (AliITSGainSSDv2 *)entryGainSSD->GetObject();
  if(!isCacheActive)entryGainSSD->SetObject(NULL);
  entryGainSSD->SetOwner(kTRUE);

  AliITSBadChannelsSSDv2 *badChannelsSSD = NULL;
  emptyssd = (TObject *)entryBadChannelsSSD->GetObject();
  ssdobjectname = emptyssd->GetName();
  if(ssdobjectname=="TObjArray") {
    TObjArray *badChannelsSSDOld = (TObjArray *)entryBadChannelsSSD->GetObject();
    badChannelsSSD = new AliITSBadChannelsSSDv2();
    ReadOldSSDBadChannels(badChannelsSSDOld, badChannelsSSD);
  }
  else if(ssdobjectname=="AliITSBadChannelsSSDv2")
    badChannelsSSD = (AliITSBadChannelsSSDv2*)entryBadChannelsSSD->GetObject();
  if(!isCacheActive)entryBadChannelsSSD->SetObject(NULL);
  entryBadChannelsSSD->SetOwner(kTRUE);

  /*AliITSNoiseSSDv2 *noiseSSD = (AliITSNoiseSSDv2 *)entryNoiseSSD->GetObject();
  if(!isCacheActive)entryNoiseSSD->SetObject(NULL);
  entryNoiseSSD->SetOwner(kTRUE);

  AliITSGainSSDv2 *gainSSD = (AliITSGainSSDv2 *)entryGainSSD->GetObject();
  if(!isCacheActive)entryGainSSD->SetObject(NULL);
  entryGainSSD->SetOwner(kTRUE);

  AliITSBadChannelsSSDv2 *badchannelsSSD = 
    (AliITSBadChannelsSSDv2 *)entryBadChannelsSSD->GetObject();
  if(!isCacheActive)entryBadChannelsSSD->SetObject(NULL);
  entryBadChannelsSSD->SetOwner(kTRUE);*/

  // DB entries are deleted. In this way metadeta objects are deleted as well
  if(!isCacheActive){
    delete deadSPD;
    delete noisySPD;
    delete foEffSPD;
    delete foNoiSPD;
    delete entrySDD;
    delete entry2SDD;
    delete entryNoiseSSD;
    delete entryGainSSD;
    delete entryBadChannelsSSD;
//    delete mapASDD;   
    delete mapTSDD;
    delete drSpSDD;
    delete ddlMapSDD;
  }
  
  AliCDBManager::Instance()->SetCacheFlag(origCacheStatus);

 if ((!calDeadSPD) || (!calNoisySPD) || (!calFoEffSPD) || (!calFoNoiSPD) 
      || (!calSDD) || (!pSDD)|| (!drSp) || (!ddlsdd)  
      || (!mapT) || (!noiseSSD)|| (!gainSSD)|| (!badChannelsSSD)) {
    AliWarning("Can not get calibration from calibration database !");
    return kFALSE;
  }


  Int_t nmods0 = calDeadSPD->GetEntries();
  Int_t nmods1 = calSDD->GetEntries();

  AliDebug(1,Form("%i SPD, %i SDD and %i SSD in calibration database",
		  nmods0,nmods1,fgkDefaultNModulesSSD));
  AliITSCalibration* cal;
  for (Int_t i=0; i<nmods0; i++) {
    cal = (AliITSCalibration*) calDeadSPD->At(i);
    SetCalibrationModel(i, cal);
    cal = (AliITSCalibration*) calNoisySPD->At(i);
    SetSPDNoisyModel(i, cal);
  }

  fFOGenerator.SetEfficiency(calFoEffSPD); // this cal object is used only by the generator
  fFOGenerator.SetNoise(calFoNoiSPD); // this cal object is used only by the generator
  
  fDDLMapSDD->SetDDLMap(ddlsdd);
  fRespSDD=pSDD;
  Float_t avegain=0.;
  Float_t nGdAnodes=0;
  Bool_t oldMapFormat=kFALSE;
  TObject* objmap=(TObject*)mapT->At(0);
  TString cname(objmap->ClassName());
  if(cname.CompareTo("AliITSMapSDD")==0){ 
    oldMapFormat=kTRUE;
    AliInfo("SDD Maps converted to new format");
  }

  for (Int_t i=0; i<fgkDefaultNModulesSDD; i++) {
    Int_t iddl,icarlos;
    Int_t iMod = i + fgkDefaultNModulesSPD;
    fDDLMapSDD->FindInDDLMap(iMod,iddl,icarlos);
    if(iddl<0){ 
      AliITSCalibrationSDD* calsdddead=new AliITSCalibrationSDD();
      calsdddead->SetBad();      
      AliITSDriftSpeedSDD* driftspdef = new AliITSDriftSpeedSDD();
      AliITSDriftSpeedArraySDD* arrdrsp=new AliITSDriftSpeedArraySDD(1);
      arrdrsp->AddDriftSpeed(driftspdef);
      calsdddead->SetDriftSpeed(0,arrdrsp);
      calsdddead->SetDriftSpeed(1,arrdrsp);
      SetCalibrationModel(iMod, calsdddead);
      AliWarning(Form("SDD module %d not present in DDL map: set it as dead",iMod));
    }else{
      cal = (AliITSCalibration*) calSDD->At(i);
      for(Int_t iAnode=0;iAnode< ((AliITSCalibrationSDD*)cal)->NOfAnodes(); iAnode++){
	if(((AliITSCalibrationSDD*)cal)->IsBadChannel(iAnode)) continue;
	avegain+= ((AliITSCalibrationSDD*)cal)->GetChannelGain(iAnode);
	nGdAnodes++;
      }
      Int_t i0=2*i;
      Int_t i1=1+2*i;
      AliITSDriftSpeedArraySDD* arr0 = (AliITSDriftSpeedArraySDD*) drSp->At(i0);
      AliITSDriftSpeedArraySDD* arr1 = (AliITSDriftSpeedArraySDD*) drSp->At(i1);

      AliITSCorrMapSDD* mt0 = 0;
      AliITSCorrMapSDD* mt1 = 0;
      if(oldMapFormat){ 
	AliITSMapSDD* oldmap0=(AliITSMapSDD*)mapT->At(i0);
	AliITSMapSDD* oldmap1=(AliITSMapSDD*)mapT->At(i1);
	mt0=oldmap0->ConvertToNewFormat();
	mt1=oldmap1->ConvertToNewFormat();
      }else{
	mt0=(AliITSCorrMapSDD*)mapT->At(i0);
	mt1=(AliITSCorrMapSDD*)mapT->At(i1);
      }
      cal->SetDriftSpeed(0,arr0);
      cal->SetDriftSpeed(1,arr1);
      cal->SetMapT(0,mt0);
      cal->SetMapT(1,mt1);
      SetCalibrationModel(iMod, cal);
    }
  }
  if(nGdAnodes) fAveGainSDD=avegain/nGdAnodes;
  AliDebug(3,Form("SDD average gain=%f\n",fAveGainSDD));
  fSSDCalibration->SetNoise(noiseSSD);
  fSSDCalibration->SetGain(gainSSD);
  fSSDCalibration->SetBadChannels(badChannelsSSD);
  //fSSDCalibration->FillBadChipMap();



  return kTRUE;
}
//_______________________________________________________________________
void AliITSDetTypeSim::SetDefaultSimulation(){
  //Set default simulation for detector type

  if(GetITSgeom()==0){
    Warning("SetDefaultSimulation","GetITSgeom() is 0!");
    return;
  }
  if(fCalibration==0){
    Warning("SetDefaultSimulation","fCalibration is 0!");
    return;
  }
  if(fSegmentation==0){
    Warning("SetDefaultSimulation","fSegmentation is 0!");
    for(Int_t i=0;i<fgkNdettypes;i++) SetDefaultSegmentation(i);
  }else for(Int_t i=0;i<fgkNdettypes;i++) if(!GetSegmentationModel(i)){
      Warning("SetDefaultSimulation",
	      "Segmentation not defined for det %d - Default taken\n!",i);
      SetDefaultSegmentation(i);
  }
  AliITSsimulation* sim;

  for(Int_t idet=0;idet<fgkNdettypes;idet++){
   //SPD
    if(idet==0){
      sim = GetSimulationModel(idet); 
      if(!sim){
	sim = new AliITSsimulationSPD(this);
	SetSimulationModel(idet,sim);
      }
    }
    //SDD
    if(idet==1){
      sim = GetSimulationModel(idet);
      if(!sim){
	sim = new AliITSsimulationSDD(this);
	SetSimulationModel(idet,sim);
      }      
    }
    //SSD
    if(idet==2){
      sim = GetSimulationModel(idet);
      if(!sim){
	sim = new AliITSsimulationSSD(this);
	SetSimulationModel(idet,sim);
      }
    }

  }
}
//___________________________________________________________________
void AliITSDetTypeSim::SetTreeAddressS(TTree* treeS, const Char_t* name){
  // Set branch address for the ITS summable digits Trees.  

  if(!treeS){
    return;
  }
  TBranch *branch;
  branch = treeS->GetBranch(name);
  TClonesArray *sdigi = &fSDigits;
  if (branch) branch->SetAddress(&sdigi);

}
//___________________________________________________________________
void AliITSDetTypeSim::SetTreeAddressD(TTree* treeD, const Char_t* name){
  // Set branch address for the digit Trees.
  
  const char *det[3] = {"SPD","SDD","SSD"};
  TBranch *branch;
  
  TString branchname;
  
  if(!treeD){
    return;
  }
  if(!fDigits){
    fDigits = new TObjArray(fgkNdettypes); 
  }
  for(Int_t i=0;i<fgkNdettypes;i++){
    const Char_t* digclass = GetDigitClassName(i);
    if(digclass==0x0){
      if(i==0) SetDigitClassName(i,"AliITSdigitSPD");
      if(i==1) SetDigitClassName(i,"AliITSdigitSDD");
      if(i==2) SetDigitClassName(i,"AliITSdigitSSD");
      digclass = GetDigitClassName(i);
    }
    TString classn = digclass;
    if(!(fDigits->At(i))){
      fDigits->AddAt(new TClonesArray(classn.Data(),1000),i);
    }else{
      ResetDigits(i);
    }
    
    if(fgkNdettypes==3) branchname.Form("%sDigits%s",name,det[i]);
    else branchname.Form("%sDigits%d",name,i+1);
    branch = treeD->GetBranch(branchname.Data());
    if(branch) branch->SetAddress(&((*fDigits)[i]));    
  }
}
//___________________________________________________________________
void AliITSDetTypeSim::ResetDigits(){
  // Reset number of digits and the digits array for the ITS detector.  

  if(!fDigits){
    Error("ResetDigits","fDigits is null!");
    return;
  }
  for(Int_t i=0;i<fgkNdettypes;i++){
    ResetDigits(i);
  }
}
//___________________________________________________________________
void AliITSDetTypeSim::ResetDigits(Int_t branch){
  // Reset number of digits and the digits array for this branch.

  if(fDigits->At(branch)){
    ((TClonesArray*)fDigits->At(branch))->Clear();
  }
  if(fNDigits) fNDigits[branch]=0;

}



//_______________________________________________________________________
void AliITSDetTypeSim::SDigitsToDigits(Option_t* opt, Char_t* name){
  // Standard Summable digits to Digits function.
  if(!GetITSgeom()){
    Warning("SDigitsToDigits","GetITSgeom() is null!!");
    return;
  }
  
  const char *all = strstr(opt,"All");
  const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
			strstr(opt,"SSD")};
  if(!all && !det[0] && !det[1] && !det[2] ) all = "All";

  static Bool_t setDef = kTRUE;
  if(setDef) SetDefaultSimulation();
  setDef = kFALSE;
  
  AliITSsimulation *sim =0;
  TTree* trees = fLoader->TreeS();
  if( !(trees && GetSDigits()) ){
    Error("SDigits2Digits","Error: No trees or SDigits. Returning.");
    return;
  } 

  TBranch* brchSDigits = trees->GetBranch(name);
  
  Int_t id;
  for(Int_t module=0;module<GetITSgeom()->GetIndexMax();module++){
     id = GetITSgeom()->GetModuleType(module);
    if (!all && !det[id]) continue;
    sim = (AliITSsimulation*)GetSimulationModel(id);
    if(!sim){
      Error("SDigit2Digits","The simulation class was not "
	    "instanciated for module %d type %s!",module,
	    GetITSgeom()->GetModuleTypeName(module));
      exit(1);
    }
    sim->InitSimulationModule(module,gAlice->GetEvNumber());
    
    fSDigits.Clear();
    brchSDigits->GetEvent(module);
    sim->AddSDigitsToModule(&fSDigits,0);
    sim->FinishSDigitiseModule();
    fLoader->TreeD()->Fill();
    ResetDigits();
  }

  WriteFOSignals(); 
  fLoader->TreeD()->GetEntries();
  fLoader->TreeD()->AutoSave();
  fLoader->TreeD()->Reset();
}
//_________________________________________________________
void AliITSDetTypeSim::AddSumDigit(AliITSpListItem &sdig){  
  //Adds the module full of summable digits to the summable digits tree.

  new(fSDigits[fNSDigits++]) AliITSpListItem(sdig);
}
//__________________________________________________________
void AliITSDetTypeSim::AddSimDigit(Int_t branch, const AliITSdigit* d){  
  //    Add a simulated digit.

  TClonesArray &ldigits = *((TClonesArray*)fDigits->At(branch));
  switch(branch){
  case 0:
    new(ldigits[fNDigits[branch]++]) AliITSdigitSPD(*((AliITSdigitSPD*)d));
    break;
  case 1:
    new(ldigits[fNDigits[branch]++]) AliITSdigitSDD(*((AliITSdigitSDD*)d));
    break;
  case 2:
    new(ldigits[fNDigits[branch]++]) AliITSdigitSSD(*((AliITSdigitSSD*)d));
    break;
  }  
}
//______________________________________________________________________
void AliITSDetTypeSim::AddSimDigit(Int_t branch,Float_t phys,Int_t *digits,
				   Int_t *tracks,Int_t *hits,Float_t *charges, 
				   Int_t sigexpanded){
  //   Add a simulated digit to the list.

  TClonesArray &ldigits = *((TClonesArray*)fDigits->At(branch));
  switch(branch){
  case 0:
    new(ldigits[fNDigits[branch]++]) AliITSdigitSPD(digits,tracks,hits);
    break;
  case 1:
    new(ldigits[fNDigits[branch]++]) AliITSdigitSDD(phys,digits,tracks,
						   hits,charges,sigexpanded);
    break;
  case 2:
    new(ldigits[fNDigits[branch]++]) AliITSdigitSSD(digits,tracks,hits);
    break;
  } 
}
//______________________________________________________________________
void AliITSDetTypeSim::ReadOldSSDNoise(const TObjArray *array, 
				       AliITSNoiseSSDv2 *noiseSSD) {
  //Reads the old SSD calibration object and converts it to the new format
  const Int_t fgkSSDSTRIPSPERMODULE = 1536;
  const Int_t fgkSSDPSIDESTRIPSPERMODULE = 768;

  Int_t gNMod = array->GetEntries();
  cout<<"Converting old calibration object for noise..."<<endl;

  //NOISE
  Double_t noise = 0.0;
  for (Int_t iModule = 0; iModule < gNMod; iModule++) {
    AliITSNoiseSSD *noiseModule = (AliITSNoiseSSD*) (array->At(iModule));
    for(Int_t iStrip = 0; iStrip < fgkSSDSTRIPSPERMODULE; iStrip++) {
      noise = (iStrip < fgkSSDPSIDESTRIPSPERMODULE) ? noiseModule->GetNoiseP(iStrip) : noiseModule->GetNoiseN(1535 - iStrip);
      if(iStrip < fgkSSDPSIDESTRIPSPERMODULE)
	noiseSSD->AddNoiseP(iModule,iStrip,noise);
      if(iStrip >= fgkSSDPSIDESTRIPSPERMODULE)
	noiseSSD->AddNoiseN(iModule,1535 - iStrip,noise);
    }//loop over strips
  }//loop over modules      
}

//______________________________________________________________________
void AliITSDetTypeSim::ReadOldSSDBadChannels(const TObjArray *array, 
					     AliITSBadChannelsSSDv2 *badChannelsSSD) {
  //Reads the old SSD calibration object and converts it to the new format
  Int_t nMod = array->GetEntries();
  cout<<"Converting old calibration object for bad channels..."<<endl;
  for (Int_t iModule = 0; iModule < nMod; iModule++) {
    //for (Int_t iModule = 0; iModule < 1; iModule++) {
    AliITSBadChannelsSSD *bad = (AliITSBadChannelsSSD*) (array->At(iModule));
    TArrayI arrayPSide = bad->GetBadPChannelsList();
    for(Int_t iPCounter = 0; iPCounter < arrayPSide.GetSize(); iPCounter++) 
      badChannelsSSD->AddBadChannelP(iModule,
				     iPCounter,
				     (Char_t)arrayPSide.At(iPCounter));
        
    TArrayI arrayNSide = bad->GetBadNChannelsList();
    for(Int_t iNCounter = 0; iNCounter < arrayNSide.GetSize(); iNCounter++) 
      badChannelsSSD->AddBadChannelN(iModule,
				     iNCounter,
				     (Char_t)arrayNSide.At(iNCounter));
    
  }//loop over modules      
}

//______________________________________________________________________
void AliITSDetTypeSim::ReadOldSSDGain(const TObjArray *array, 
				      AliITSGainSSDv2 *gainSSD) {
  //Reads the old SSD calibration object and converts it to the new format

  Int_t nMod = array->GetEntries();
  cout<<"Converting old calibration object for gain..."<<endl;

  //GAIN
  for (Int_t iModule = 0; iModule < nMod; iModule++) {
    AliITSGainSSD *gainModule = (AliITSGainSSD*) (array->At(iModule));
    TArrayF arrayPSide = gainModule->GetGainP();
    for(Int_t iPCounter = 0; iPCounter < arrayPSide.GetSize(); iPCounter++)
      gainSSD->AddGainP(iModule,
			iPCounter,
			arrayPSide.At(iPCounter));
    TArrayF arrayNSide = gainModule->GetGainN();
    for(Int_t iNCounter = 0; iNCounter < arrayNSide.GetSize(); iNCounter++)
      gainSSD->AddGainN(iModule,
			iNCounter,
			arrayNSide.At(iNCounter));
  }//loop over modules 
}
//______________________________________________________________________
void AliITSDetTypeSim::ProcessSPDDigitForFastOr(UInt_t module, UInt_t colM, UInt_t rowM) {
  // Processes wether a single fired pixel will give rise to a fast-or signal
  fFOGenerator.ProcessPixelHitM(module,colM,rowM);
}
//_______________________________________________________________________
AliITSTriggerConditions* AliITSDetTypeSim::GetTriggerConditions() {
  // Get Pixel Trigger Conditions (separate method since it is used only when simulating trigger)
  if (fTriggerConditions==NULL) { // read from db
    fRunNumber = ((Int_t)AliCDBManager::Instance()->GetRun());
    Bool_t origCacheStatus = AliCDBManager::Instance()->GetCacheFlag();
    Bool_t isCacheActive;
    if (fRunNumber<0) isCacheActive=kFALSE;
    else              isCacheActive=kTRUE;
    AliCDBManager::Instance()->SetCacheFlag(isCacheActive);
    AliCDBEntry *pitCond = AliCDBManager::Instance()->Get("TRIGGER/SPD/PITConditions", fRunNumber);
    if (!pitCond) {
      AliError("Trigger conditions retrieval failed! ");
      return NULL;
    }
    fTriggerConditions = (AliITSTriggerConditions*) pitCond->GetObject();
    if (!isCacheActive) pitCond->SetObject(NULL);
    pitCond->SetOwner(kTRUE);
    if (!isCacheActive) {
      delete pitCond;
    }
    AliCDBManager::Instance()->SetCacheFlag(origCacheStatus);
    if (fTriggerConditions==NULL) {
      AliWarning("fTriggerConditions is NULL!");
    }
  }
  return fTriggerConditions;
}
//_______________________________________________________________________
void AliITSDetTypeSim::WriteFOSignals() {
  // write fo signals to event

  if (!fLoader) {
    AliError("ITS loader is NULL.");
    return;
  }

  if(!fLoader->TreeD()){
   AliError("No TreeD available");
   return;
  }
  TTree *tree = fLoader->TreeD();
  AliITSFOSignalsSPD *foSignals = new AliITSFOSignalsSPD(*GetFOSignals()); 
  tree->GetUserInfo()->Add(foSignals);
  fFOGenerator.ResetSignals();
}

 AliITSDetTypeSim.cxx:1
 AliITSDetTypeSim.cxx:2
 AliITSDetTypeSim.cxx:3
 AliITSDetTypeSim.cxx:4
 AliITSDetTypeSim.cxx:5
 AliITSDetTypeSim.cxx:6
 AliITSDetTypeSim.cxx:7
 AliITSDetTypeSim.cxx:8
 AliITSDetTypeSim.cxx:9
 AliITSDetTypeSim.cxx:10
 AliITSDetTypeSim.cxx:11
 AliITSDetTypeSim.cxx:12
 AliITSDetTypeSim.cxx:13
 AliITSDetTypeSim.cxx:14
 AliITSDetTypeSim.cxx:15
 AliITSDetTypeSim.cxx:16
 AliITSDetTypeSim.cxx:17
 AliITSDetTypeSim.cxx:18
 AliITSDetTypeSim.cxx:19
 AliITSDetTypeSim.cxx:20
 AliITSDetTypeSim.cxx:21
 AliITSDetTypeSim.cxx:22
 AliITSDetTypeSim.cxx:23
 AliITSDetTypeSim.cxx:24
 AliITSDetTypeSim.cxx:25
 AliITSDetTypeSim.cxx:26
 AliITSDetTypeSim.cxx:27
 AliITSDetTypeSim.cxx:28
 AliITSDetTypeSim.cxx:29
 AliITSDetTypeSim.cxx:30
 AliITSDetTypeSim.cxx:31
 AliITSDetTypeSim.cxx:32
 AliITSDetTypeSim.cxx:33
 AliITSDetTypeSim.cxx:34
 AliITSDetTypeSim.cxx:35
 AliITSDetTypeSim.cxx:36
 AliITSDetTypeSim.cxx:37
 AliITSDetTypeSim.cxx:38
 AliITSDetTypeSim.cxx:39
 AliITSDetTypeSim.cxx:40
 AliITSDetTypeSim.cxx:41
 AliITSDetTypeSim.cxx:42
 AliITSDetTypeSim.cxx:43
 AliITSDetTypeSim.cxx:44
 AliITSDetTypeSim.cxx:45
 AliITSDetTypeSim.cxx:46
 AliITSDetTypeSim.cxx:47
 AliITSDetTypeSim.cxx:48
 AliITSDetTypeSim.cxx:49
 AliITSDetTypeSim.cxx:50
 AliITSDetTypeSim.cxx:51
 AliITSDetTypeSim.cxx:52
 AliITSDetTypeSim.cxx:53
 AliITSDetTypeSim.cxx:54
 AliITSDetTypeSim.cxx:55
 AliITSDetTypeSim.cxx:56
 AliITSDetTypeSim.cxx:57
 AliITSDetTypeSim.cxx:58
 AliITSDetTypeSim.cxx:59
 AliITSDetTypeSim.cxx:60
 AliITSDetTypeSim.cxx:61
 AliITSDetTypeSim.cxx:62
 AliITSDetTypeSim.cxx:63
 AliITSDetTypeSim.cxx:64
 AliITSDetTypeSim.cxx:65
 AliITSDetTypeSim.cxx:66
 AliITSDetTypeSim.cxx:67
 AliITSDetTypeSim.cxx:68
 AliITSDetTypeSim.cxx:69
 AliITSDetTypeSim.cxx:70
 AliITSDetTypeSim.cxx:71
 AliITSDetTypeSim.cxx:72
 AliITSDetTypeSim.cxx:73
 AliITSDetTypeSim.cxx:74
 AliITSDetTypeSim.cxx:75
 AliITSDetTypeSim.cxx:76
 AliITSDetTypeSim.cxx:77
 AliITSDetTypeSim.cxx:78
 AliITSDetTypeSim.cxx:79
 AliITSDetTypeSim.cxx:80
 AliITSDetTypeSim.cxx:81
 AliITSDetTypeSim.cxx:82
 AliITSDetTypeSim.cxx:83
 AliITSDetTypeSim.cxx:84
 AliITSDetTypeSim.cxx:85
 AliITSDetTypeSim.cxx:86
 AliITSDetTypeSim.cxx:87
 AliITSDetTypeSim.cxx:88
 AliITSDetTypeSim.cxx:89
 AliITSDetTypeSim.cxx:90
 AliITSDetTypeSim.cxx:91
 AliITSDetTypeSim.cxx:92
 AliITSDetTypeSim.cxx:93
 AliITSDetTypeSim.cxx:94
 AliITSDetTypeSim.cxx:95
 AliITSDetTypeSim.cxx:96
 AliITSDetTypeSim.cxx:97
 AliITSDetTypeSim.cxx:98
 AliITSDetTypeSim.cxx:99
 AliITSDetTypeSim.cxx:100
 AliITSDetTypeSim.cxx:101
 AliITSDetTypeSim.cxx:102
 AliITSDetTypeSim.cxx:103
 AliITSDetTypeSim.cxx:104
 AliITSDetTypeSim.cxx:105
 AliITSDetTypeSim.cxx:106
 AliITSDetTypeSim.cxx:107
 AliITSDetTypeSim.cxx:108
 AliITSDetTypeSim.cxx:109
 AliITSDetTypeSim.cxx:110
 AliITSDetTypeSim.cxx:111
 AliITSDetTypeSim.cxx:112
 AliITSDetTypeSim.cxx:113
 AliITSDetTypeSim.cxx:114
 AliITSDetTypeSim.cxx:115
 AliITSDetTypeSim.cxx:116
 AliITSDetTypeSim.cxx:117
 AliITSDetTypeSim.cxx:118
 AliITSDetTypeSim.cxx:119
 AliITSDetTypeSim.cxx:120
 AliITSDetTypeSim.cxx:121
 AliITSDetTypeSim.cxx:122
 AliITSDetTypeSim.cxx:123
 AliITSDetTypeSim.cxx:124
 AliITSDetTypeSim.cxx:125
 AliITSDetTypeSim.cxx:126
 AliITSDetTypeSim.cxx:127
 AliITSDetTypeSim.cxx:128
 AliITSDetTypeSim.cxx:129
 AliITSDetTypeSim.cxx:130
 AliITSDetTypeSim.cxx:131
 AliITSDetTypeSim.cxx:132
 AliITSDetTypeSim.cxx:133
 AliITSDetTypeSim.cxx:134
 AliITSDetTypeSim.cxx:135
 AliITSDetTypeSim.cxx:136
 AliITSDetTypeSim.cxx:137
 AliITSDetTypeSim.cxx:138
 AliITSDetTypeSim.cxx:139
 AliITSDetTypeSim.cxx:140
 AliITSDetTypeSim.cxx:141
 AliITSDetTypeSim.cxx:142
 AliITSDetTypeSim.cxx:143
 AliITSDetTypeSim.cxx:144
 AliITSDetTypeSim.cxx:145
 AliITSDetTypeSim.cxx:146
 AliITSDetTypeSim.cxx:147
 AliITSDetTypeSim.cxx:148
 AliITSDetTypeSim.cxx:149
 AliITSDetTypeSim.cxx:150
 AliITSDetTypeSim.cxx:151
 AliITSDetTypeSim.cxx:152
 AliITSDetTypeSim.cxx:153
 AliITSDetTypeSim.cxx:154
 AliITSDetTypeSim.cxx:155
 AliITSDetTypeSim.cxx:156
 AliITSDetTypeSim.cxx:157
 AliITSDetTypeSim.cxx:158
 AliITSDetTypeSim.cxx:159
 AliITSDetTypeSim.cxx:160
 AliITSDetTypeSim.cxx:161
 AliITSDetTypeSim.cxx:162
 AliITSDetTypeSim.cxx:163
 AliITSDetTypeSim.cxx:164
 AliITSDetTypeSim.cxx:165
 AliITSDetTypeSim.cxx:166
 AliITSDetTypeSim.cxx:167
 AliITSDetTypeSim.cxx:168
 AliITSDetTypeSim.cxx:169
 AliITSDetTypeSim.cxx:170
 AliITSDetTypeSim.cxx:171
 AliITSDetTypeSim.cxx:172
 AliITSDetTypeSim.cxx:173
 AliITSDetTypeSim.cxx:174
 AliITSDetTypeSim.cxx:175
 AliITSDetTypeSim.cxx:176
 AliITSDetTypeSim.cxx:177
 AliITSDetTypeSim.cxx:178
 AliITSDetTypeSim.cxx:179
 AliITSDetTypeSim.cxx:180
 AliITSDetTypeSim.cxx:181
 AliITSDetTypeSim.cxx:182
 AliITSDetTypeSim.cxx:183
 AliITSDetTypeSim.cxx:184
 AliITSDetTypeSim.cxx:185
 AliITSDetTypeSim.cxx:186
 AliITSDetTypeSim.cxx:187
 AliITSDetTypeSim.cxx:188
 AliITSDetTypeSim.cxx:189
 AliITSDetTypeSim.cxx:190
 AliITSDetTypeSim.cxx:191
 AliITSDetTypeSim.cxx:192
 AliITSDetTypeSim.cxx:193
 AliITSDetTypeSim.cxx:194
 AliITSDetTypeSim.cxx:195
 AliITSDetTypeSim.cxx:196
 AliITSDetTypeSim.cxx:197
 AliITSDetTypeSim.cxx:198
 AliITSDetTypeSim.cxx:199
 AliITSDetTypeSim.cxx:200
 AliITSDetTypeSim.cxx:201
 AliITSDetTypeSim.cxx:202
 AliITSDetTypeSim.cxx:203
 AliITSDetTypeSim.cxx:204
 AliITSDetTypeSim.cxx:205
 AliITSDetTypeSim.cxx:206
 AliITSDetTypeSim.cxx:207
 AliITSDetTypeSim.cxx:208
 AliITSDetTypeSim.cxx:209
 AliITSDetTypeSim.cxx:210
 AliITSDetTypeSim.cxx:211
 AliITSDetTypeSim.cxx:212
 AliITSDetTypeSim.cxx:213
 AliITSDetTypeSim.cxx:214
 AliITSDetTypeSim.cxx:215
 AliITSDetTypeSim.cxx:216
 AliITSDetTypeSim.cxx:217
 AliITSDetTypeSim.cxx:218
 AliITSDetTypeSim.cxx:219
 AliITSDetTypeSim.cxx:220
 AliITSDetTypeSim.cxx:221
 AliITSDetTypeSim.cxx:222
 AliITSDetTypeSim.cxx:223
 AliITSDetTypeSim.cxx:224
 AliITSDetTypeSim.cxx:225
 AliITSDetTypeSim.cxx:226
 AliITSDetTypeSim.cxx:227
 AliITSDetTypeSim.cxx:228
 AliITSDetTypeSim.cxx:229
 AliITSDetTypeSim.cxx:230
 AliITSDetTypeSim.cxx:231
 AliITSDetTypeSim.cxx:232
 AliITSDetTypeSim.cxx:233
 AliITSDetTypeSim.cxx:234
 AliITSDetTypeSim.cxx:235
 AliITSDetTypeSim.cxx:236
 AliITSDetTypeSim.cxx:237
 AliITSDetTypeSim.cxx:238
 AliITSDetTypeSim.cxx:239
 AliITSDetTypeSim.cxx:240
 AliITSDetTypeSim.cxx:241
 AliITSDetTypeSim.cxx:242
 AliITSDetTypeSim.cxx:243
 AliITSDetTypeSim.cxx:244
 AliITSDetTypeSim.cxx:245
 AliITSDetTypeSim.cxx:246
 AliITSDetTypeSim.cxx:247
 AliITSDetTypeSim.cxx:248
 AliITSDetTypeSim.cxx:249
 AliITSDetTypeSim.cxx:250
 AliITSDetTypeSim.cxx:251
 AliITSDetTypeSim.cxx:252
 AliITSDetTypeSim.cxx:253
 AliITSDetTypeSim.cxx:254
 AliITSDetTypeSim.cxx:255
 AliITSDetTypeSim.cxx:256
 AliITSDetTypeSim.cxx:257
 AliITSDetTypeSim.cxx:258
 AliITSDetTypeSim.cxx:259
 AliITSDetTypeSim.cxx:260
 AliITSDetTypeSim.cxx:261
 AliITSDetTypeSim.cxx:262
 AliITSDetTypeSim.cxx:263
 AliITSDetTypeSim.cxx:264
 AliITSDetTypeSim.cxx:265
 AliITSDetTypeSim.cxx:266
 AliITSDetTypeSim.cxx:267
 AliITSDetTypeSim.cxx:268
 AliITSDetTypeSim.cxx:269
 AliITSDetTypeSim.cxx:270
 AliITSDetTypeSim.cxx:271
 AliITSDetTypeSim.cxx:272
 AliITSDetTypeSim.cxx:273
 AliITSDetTypeSim.cxx:274
 AliITSDetTypeSim.cxx:275
 AliITSDetTypeSim.cxx:276
 AliITSDetTypeSim.cxx:277
 AliITSDetTypeSim.cxx:278
 AliITSDetTypeSim.cxx:279
 AliITSDetTypeSim.cxx:280
 AliITSDetTypeSim.cxx:281
 AliITSDetTypeSim.cxx:282
 AliITSDetTypeSim.cxx:283
 AliITSDetTypeSim.cxx:284
 AliITSDetTypeSim.cxx:285
 AliITSDetTypeSim.cxx:286
 AliITSDetTypeSim.cxx:287
 AliITSDetTypeSim.cxx:288
 AliITSDetTypeSim.cxx:289
 AliITSDetTypeSim.cxx:290
 AliITSDetTypeSim.cxx:291
 AliITSDetTypeSim.cxx:292
 AliITSDetTypeSim.cxx:293
 AliITSDetTypeSim.cxx:294
 AliITSDetTypeSim.cxx:295
 AliITSDetTypeSim.cxx:296
 AliITSDetTypeSim.cxx:297
 AliITSDetTypeSim.cxx:298
 AliITSDetTypeSim.cxx:299
 AliITSDetTypeSim.cxx:300
 AliITSDetTypeSim.cxx:301
 AliITSDetTypeSim.cxx:302
 AliITSDetTypeSim.cxx:303
 AliITSDetTypeSim.cxx:304
 AliITSDetTypeSim.cxx:305
 AliITSDetTypeSim.cxx:306
 AliITSDetTypeSim.cxx:307
 AliITSDetTypeSim.cxx:308
 AliITSDetTypeSim.cxx:309
 AliITSDetTypeSim.cxx:310
 AliITSDetTypeSim.cxx:311
 AliITSDetTypeSim.cxx:312
 AliITSDetTypeSim.cxx:313
 AliITSDetTypeSim.cxx:314
 AliITSDetTypeSim.cxx:315
 AliITSDetTypeSim.cxx:316
 AliITSDetTypeSim.cxx:317
 AliITSDetTypeSim.cxx:318
 AliITSDetTypeSim.cxx:319
 AliITSDetTypeSim.cxx:320
 AliITSDetTypeSim.cxx:321
 AliITSDetTypeSim.cxx:322
 AliITSDetTypeSim.cxx:323
 AliITSDetTypeSim.cxx:324
 AliITSDetTypeSim.cxx:325
 AliITSDetTypeSim.cxx:326
 AliITSDetTypeSim.cxx:327
 AliITSDetTypeSim.cxx:328
 AliITSDetTypeSim.cxx:329
 AliITSDetTypeSim.cxx:330
 AliITSDetTypeSim.cxx:331
 AliITSDetTypeSim.cxx:332
 AliITSDetTypeSim.cxx:333
 AliITSDetTypeSim.cxx:334
 AliITSDetTypeSim.cxx:335
 AliITSDetTypeSim.cxx:336
 AliITSDetTypeSim.cxx:337
 AliITSDetTypeSim.cxx:338
 AliITSDetTypeSim.cxx:339
 AliITSDetTypeSim.cxx:340
 AliITSDetTypeSim.cxx:341
 AliITSDetTypeSim.cxx:342
 AliITSDetTypeSim.cxx:343
 AliITSDetTypeSim.cxx:344
 AliITSDetTypeSim.cxx:345
 AliITSDetTypeSim.cxx:346
 AliITSDetTypeSim.cxx:347
 AliITSDetTypeSim.cxx:348
 AliITSDetTypeSim.cxx:349
 AliITSDetTypeSim.cxx:350
 AliITSDetTypeSim.cxx:351
 AliITSDetTypeSim.cxx:352
 AliITSDetTypeSim.cxx:353
 AliITSDetTypeSim.cxx:354
 AliITSDetTypeSim.cxx:355
 AliITSDetTypeSim.cxx:356
 AliITSDetTypeSim.cxx:357
 AliITSDetTypeSim.cxx:358
 AliITSDetTypeSim.cxx:359
 AliITSDetTypeSim.cxx:360
 AliITSDetTypeSim.cxx:361
 AliITSDetTypeSim.cxx:362
 AliITSDetTypeSim.cxx:363
 AliITSDetTypeSim.cxx:364
 AliITSDetTypeSim.cxx:365
 AliITSDetTypeSim.cxx:366
 AliITSDetTypeSim.cxx:367
 AliITSDetTypeSim.cxx:368
 AliITSDetTypeSim.cxx:369
 AliITSDetTypeSim.cxx:370
 AliITSDetTypeSim.cxx:371
 AliITSDetTypeSim.cxx:372
 AliITSDetTypeSim.cxx:373
 AliITSDetTypeSim.cxx:374
 AliITSDetTypeSim.cxx:375
 AliITSDetTypeSim.cxx:376
 AliITSDetTypeSim.cxx:377
 AliITSDetTypeSim.cxx:378
 AliITSDetTypeSim.cxx:379
 AliITSDetTypeSim.cxx:380
 AliITSDetTypeSim.cxx:381
 AliITSDetTypeSim.cxx:382
 AliITSDetTypeSim.cxx:383
 AliITSDetTypeSim.cxx:384
 AliITSDetTypeSim.cxx:385
 AliITSDetTypeSim.cxx:386
 AliITSDetTypeSim.cxx:387
 AliITSDetTypeSim.cxx:388
 AliITSDetTypeSim.cxx:389
 AliITSDetTypeSim.cxx:390
 AliITSDetTypeSim.cxx:391
 AliITSDetTypeSim.cxx:392
 AliITSDetTypeSim.cxx:393
 AliITSDetTypeSim.cxx:394
 AliITSDetTypeSim.cxx:395
 AliITSDetTypeSim.cxx:396
 AliITSDetTypeSim.cxx:397
 AliITSDetTypeSim.cxx:398
 AliITSDetTypeSim.cxx:399
 AliITSDetTypeSim.cxx:400
 AliITSDetTypeSim.cxx:401
 AliITSDetTypeSim.cxx:402
 AliITSDetTypeSim.cxx:403
 AliITSDetTypeSim.cxx:404
 AliITSDetTypeSim.cxx:405
 AliITSDetTypeSim.cxx:406
 AliITSDetTypeSim.cxx:407
 AliITSDetTypeSim.cxx:408
 AliITSDetTypeSim.cxx:409
 AliITSDetTypeSim.cxx:410
 AliITSDetTypeSim.cxx:411
 AliITSDetTypeSim.cxx:412
 AliITSDetTypeSim.cxx:413
 AliITSDetTypeSim.cxx:414
 AliITSDetTypeSim.cxx:415
 AliITSDetTypeSim.cxx:416
 AliITSDetTypeSim.cxx:417
 AliITSDetTypeSim.cxx:418
 AliITSDetTypeSim.cxx:419
 AliITSDetTypeSim.cxx:420
 AliITSDetTypeSim.cxx:421
 AliITSDetTypeSim.cxx:422
 AliITSDetTypeSim.cxx:423
 AliITSDetTypeSim.cxx:424
 AliITSDetTypeSim.cxx:425
 AliITSDetTypeSim.cxx:426
 AliITSDetTypeSim.cxx:427
 AliITSDetTypeSim.cxx:428
 AliITSDetTypeSim.cxx:429
 AliITSDetTypeSim.cxx:430
 AliITSDetTypeSim.cxx:431
 AliITSDetTypeSim.cxx:432
 AliITSDetTypeSim.cxx:433
 AliITSDetTypeSim.cxx:434
 AliITSDetTypeSim.cxx:435
 AliITSDetTypeSim.cxx:436
 AliITSDetTypeSim.cxx:437
 AliITSDetTypeSim.cxx:438
 AliITSDetTypeSim.cxx:439
 AliITSDetTypeSim.cxx:440
 AliITSDetTypeSim.cxx:441
 AliITSDetTypeSim.cxx:442
 AliITSDetTypeSim.cxx:443
 AliITSDetTypeSim.cxx:444
 AliITSDetTypeSim.cxx:445
 AliITSDetTypeSim.cxx:446
 AliITSDetTypeSim.cxx:447
 AliITSDetTypeSim.cxx:448
 AliITSDetTypeSim.cxx:449
 AliITSDetTypeSim.cxx:450
 AliITSDetTypeSim.cxx:451
 AliITSDetTypeSim.cxx:452
 AliITSDetTypeSim.cxx:453
 AliITSDetTypeSim.cxx:454
 AliITSDetTypeSim.cxx:455
 AliITSDetTypeSim.cxx:456
 AliITSDetTypeSim.cxx:457
 AliITSDetTypeSim.cxx:458
 AliITSDetTypeSim.cxx:459
 AliITSDetTypeSim.cxx:460
 AliITSDetTypeSim.cxx:461
 AliITSDetTypeSim.cxx:462
 AliITSDetTypeSim.cxx:463
 AliITSDetTypeSim.cxx:464
 AliITSDetTypeSim.cxx:465
 AliITSDetTypeSim.cxx:466
 AliITSDetTypeSim.cxx:467
 AliITSDetTypeSim.cxx:468
 AliITSDetTypeSim.cxx:469
 AliITSDetTypeSim.cxx:470
 AliITSDetTypeSim.cxx:471
 AliITSDetTypeSim.cxx:472
 AliITSDetTypeSim.cxx:473
 AliITSDetTypeSim.cxx:474
 AliITSDetTypeSim.cxx:475
 AliITSDetTypeSim.cxx:476
 AliITSDetTypeSim.cxx:477
 AliITSDetTypeSim.cxx:478
 AliITSDetTypeSim.cxx:479
 AliITSDetTypeSim.cxx:480
 AliITSDetTypeSim.cxx:481
 AliITSDetTypeSim.cxx:482
 AliITSDetTypeSim.cxx:483
 AliITSDetTypeSim.cxx:484
 AliITSDetTypeSim.cxx:485
 AliITSDetTypeSim.cxx:486
 AliITSDetTypeSim.cxx:487
 AliITSDetTypeSim.cxx:488
 AliITSDetTypeSim.cxx:489
 AliITSDetTypeSim.cxx:490
 AliITSDetTypeSim.cxx:491
 AliITSDetTypeSim.cxx:492
 AliITSDetTypeSim.cxx:493
 AliITSDetTypeSim.cxx:494
 AliITSDetTypeSim.cxx:495
 AliITSDetTypeSim.cxx:496
 AliITSDetTypeSim.cxx:497
 AliITSDetTypeSim.cxx:498
 AliITSDetTypeSim.cxx:499
 AliITSDetTypeSim.cxx:500
 AliITSDetTypeSim.cxx:501
 AliITSDetTypeSim.cxx:502
 AliITSDetTypeSim.cxx:503
 AliITSDetTypeSim.cxx:504
 AliITSDetTypeSim.cxx:505
 AliITSDetTypeSim.cxx:506
 AliITSDetTypeSim.cxx:507
 AliITSDetTypeSim.cxx:508
 AliITSDetTypeSim.cxx:509
 AliITSDetTypeSim.cxx:510
 AliITSDetTypeSim.cxx:511
 AliITSDetTypeSim.cxx:512
 AliITSDetTypeSim.cxx:513
 AliITSDetTypeSim.cxx:514
 AliITSDetTypeSim.cxx:515
 AliITSDetTypeSim.cxx:516
 AliITSDetTypeSim.cxx:517
 AliITSDetTypeSim.cxx:518
 AliITSDetTypeSim.cxx:519
 AliITSDetTypeSim.cxx:520
 AliITSDetTypeSim.cxx:521
 AliITSDetTypeSim.cxx:522
 AliITSDetTypeSim.cxx:523
 AliITSDetTypeSim.cxx:524
 AliITSDetTypeSim.cxx:525
 AliITSDetTypeSim.cxx:526
 AliITSDetTypeSim.cxx:527
 AliITSDetTypeSim.cxx:528
 AliITSDetTypeSim.cxx:529
 AliITSDetTypeSim.cxx:530
 AliITSDetTypeSim.cxx:531
 AliITSDetTypeSim.cxx:532
 AliITSDetTypeSim.cxx:533
 AliITSDetTypeSim.cxx:534
 AliITSDetTypeSim.cxx:535
 AliITSDetTypeSim.cxx:536
 AliITSDetTypeSim.cxx:537
 AliITSDetTypeSim.cxx:538
 AliITSDetTypeSim.cxx:539
 AliITSDetTypeSim.cxx:540
 AliITSDetTypeSim.cxx:541
 AliITSDetTypeSim.cxx:542
 AliITSDetTypeSim.cxx:543
 AliITSDetTypeSim.cxx:544
 AliITSDetTypeSim.cxx:545
 AliITSDetTypeSim.cxx:546
 AliITSDetTypeSim.cxx:547
 AliITSDetTypeSim.cxx:548
 AliITSDetTypeSim.cxx:549
 AliITSDetTypeSim.cxx:550
 AliITSDetTypeSim.cxx:551
 AliITSDetTypeSim.cxx:552
 AliITSDetTypeSim.cxx:553
 AliITSDetTypeSim.cxx:554
 AliITSDetTypeSim.cxx:555
 AliITSDetTypeSim.cxx:556
 AliITSDetTypeSim.cxx:557
 AliITSDetTypeSim.cxx:558
 AliITSDetTypeSim.cxx:559
 AliITSDetTypeSim.cxx:560
 AliITSDetTypeSim.cxx:561
 AliITSDetTypeSim.cxx:562
 AliITSDetTypeSim.cxx:563
 AliITSDetTypeSim.cxx:564
 AliITSDetTypeSim.cxx:565
 AliITSDetTypeSim.cxx:566
 AliITSDetTypeSim.cxx:567
 AliITSDetTypeSim.cxx:568
 AliITSDetTypeSim.cxx:569
 AliITSDetTypeSim.cxx:570
 AliITSDetTypeSim.cxx:571
 AliITSDetTypeSim.cxx:572
 AliITSDetTypeSim.cxx:573
 AliITSDetTypeSim.cxx:574
 AliITSDetTypeSim.cxx:575
 AliITSDetTypeSim.cxx:576
 AliITSDetTypeSim.cxx:577
 AliITSDetTypeSim.cxx:578
 AliITSDetTypeSim.cxx:579
 AliITSDetTypeSim.cxx:580
 AliITSDetTypeSim.cxx:581
 AliITSDetTypeSim.cxx:582
 AliITSDetTypeSim.cxx:583
 AliITSDetTypeSim.cxx:584
 AliITSDetTypeSim.cxx:585
 AliITSDetTypeSim.cxx:586
 AliITSDetTypeSim.cxx:587
 AliITSDetTypeSim.cxx:588
 AliITSDetTypeSim.cxx:589
 AliITSDetTypeSim.cxx:590
 AliITSDetTypeSim.cxx:591
 AliITSDetTypeSim.cxx:592
 AliITSDetTypeSim.cxx:593
 AliITSDetTypeSim.cxx:594
 AliITSDetTypeSim.cxx:595
 AliITSDetTypeSim.cxx:596
 AliITSDetTypeSim.cxx:597
 AliITSDetTypeSim.cxx:598
 AliITSDetTypeSim.cxx:599
 AliITSDetTypeSim.cxx:600
 AliITSDetTypeSim.cxx:601
 AliITSDetTypeSim.cxx:602
 AliITSDetTypeSim.cxx:603
 AliITSDetTypeSim.cxx:604
 AliITSDetTypeSim.cxx:605
 AliITSDetTypeSim.cxx:606
 AliITSDetTypeSim.cxx:607
 AliITSDetTypeSim.cxx:608
 AliITSDetTypeSim.cxx:609
 AliITSDetTypeSim.cxx:610
 AliITSDetTypeSim.cxx:611
 AliITSDetTypeSim.cxx:612
 AliITSDetTypeSim.cxx:613
 AliITSDetTypeSim.cxx:614
 AliITSDetTypeSim.cxx:615
 AliITSDetTypeSim.cxx:616
 AliITSDetTypeSim.cxx:617
 AliITSDetTypeSim.cxx:618
 AliITSDetTypeSim.cxx:619
 AliITSDetTypeSim.cxx:620
 AliITSDetTypeSim.cxx:621
 AliITSDetTypeSim.cxx:622
 AliITSDetTypeSim.cxx:623
 AliITSDetTypeSim.cxx:624
 AliITSDetTypeSim.cxx:625
 AliITSDetTypeSim.cxx:626
 AliITSDetTypeSim.cxx:627
 AliITSDetTypeSim.cxx:628
 AliITSDetTypeSim.cxx:629
 AliITSDetTypeSim.cxx:630
 AliITSDetTypeSim.cxx:631
 AliITSDetTypeSim.cxx:632
 AliITSDetTypeSim.cxx:633
 AliITSDetTypeSim.cxx:634
 AliITSDetTypeSim.cxx:635
 AliITSDetTypeSim.cxx:636
 AliITSDetTypeSim.cxx:637
 AliITSDetTypeSim.cxx:638
 AliITSDetTypeSim.cxx:639
 AliITSDetTypeSim.cxx:640
 AliITSDetTypeSim.cxx:641
 AliITSDetTypeSim.cxx:642
 AliITSDetTypeSim.cxx:643
 AliITSDetTypeSim.cxx:644
 AliITSDetTypeSim.cxx:645
 AliITSDetTypeSim.cxx:646
 AliITSDetTypeSim.cxx:647
 AliITSDetTypeSim.cxx:648
 AliITSDetTypeSim.cxx:649
 AliITSDetTypeSim.cxx:650
 AliITSDetTypeSim.cxx:651
 AliITSDetTypeSim.cxx:652
 AliITSDetTypeSim.cxx:653
 AliITSDetTypeSim.cxx:654
 AliITSDetTypeSim.cxx:655
 AliITSDetTypeSim.cxx:656
 AliITSDetTypeSim.cxx:657
 AliITSDetTypeSim.cxx:658
 AliITSDetTypeSim.cxx:659
 AliITSDetTypeSim.cxx:660
 AliITSDetTypeSim.cxx:661
 AliITSDetTypeSim.cxx:662
 AliITSDetTypeSim.cxx:663
 AliITSDetTypeSim.cxx:664
 AliITSDetTypeSim.cxx:665
 AliITSDetTypeSim.cxx:666
 AliITSDetTypeSim.cxx:667
 AliITSDetTypeSim.cxx:668
 AliITSDetTypeSim.cxx:669
 AliITSDetTypeSim.cxx:670
 AliITSDetTypeSim.cxx:671
 AliITSDetTypeSim.cxx:672
 AliITSDetTypeSim.cxx:673
 AliITSDetTypeSim.cxx:674
 AliITSDetTypeSim.cxx:675
 AliITSDetTypeSim.cxx:676
 AliITSDetTypeSim.cxx:677
 AliITSDetTypeSim.cxx:678
 AliITSDetTypeSim.cxx:679
 AliITSDetTypeSim.cxx:680
 AliITSDetTypeSim.cxx:681
 AliITSDetTypeSim.cxx:682
 AliITSDetTypeSim.cxx:683
 AliITSDetTypeSim.cxx:684
 AliITSDetTypeSim.cxx:685
 AliITSDetTypeSim.cxx:686
 AliITSDetTypeSim.cxx:687
 AliITSDetTypeSim.cxx:688
 AliITSDetTypeSim.cxx:689
 AliITSDetTypeSim.cxx:690
 AliITSDetTypeSim.cxx:691
 AliITSDetTypeSim.cxx:692
 AliITSDetTypeSim.cxx:693
 AliITSDetTypeSim.cxx:694
 AliITSDetTypeSim.cxx:695
 AliITSDetTypeSim.cxx:696
 AliITSDetTypeSim.cxx:697
 AliITSDetTypeSim.cxx:698
 AliITSDetTypeSim.cxx:699
 AliITSDetTypeSim.cxx:700
 AliITSDetTypeSim.cxx:701
 AliITSDetTypeSim.cxx:702
 AliITSDetTypeSim.cxx:703
 AliITSDetTypeSim.cxx:704
 AliITSDetTypeSim.cxx:705
 AliITSDetTypeSim.cxx:706
 AliITSDetTypeSim.cxx:707
 AliITSDetTypeSim.cxx:708
 AliITSDetTypeSim.cxx:709
 AliITSDetTypeSim.cxx:710
 AliITSDetTypeSim.cxx:711
 AliITSDetTypeSim.cxx:712
 AliITSDetTypeSim.cxx:713
 AliITSDetTypeSim.cxx:714
 AliITSDetTypeSim.cxx:715
 AliITSDetTypeSim.cxx:716
 AliITSDetTypeSim.cxx:717
 AliITSDetTypeSim.cxx:718
 AliITSDetTypeSim.cxx:719
 AliITSDetTypeSim.cxx:720
 AliITSDetTypeSim.cxx:721
 AliITSDetTypeSim.cxx:722
 AliITSDetTypeSim.cxx:723
 AliITSDetTypeSim.cxx:724
 AliITSDetTypeSim.cxx:725
 AliITSDetTypeSim.cxx:726
 AliITSDetTypeSim.cxx:727
 AliITSDetTypeSim.cxx:728
 AliITSDetTypeSim.cxx:729
 AliITSDetTypeSim.cxx:730
 AliITSDetTypeSim.cxx:731
 AliITSDetTypeSim.cxx:732
 AliITSDetTypeSim.cxx:733
 AliITSDetTypeSim.cxx:734
 AliITSDetTypeSim.cxx:735
 AliITSDetTypeSim.cxx:736
 AliITSDetTypeSim.cxx:737
 AliITSDetTypeSim.cxx:738
 AliITSDetTypeSim.cxx:739
 AliITSDetTypeSim.cxx:740
 AliITSDetTypeSim.cxx:741
 AliITSDetTypeSim.cxx:742
 AliITSDetTypeSim.cxx:743
 AliITSDetTypeSim.cxx:744
 AliITSDetTypeSim.cxx:745
 AliITSDetTypeSim.cxx:746
 AliITSDetTypeSim.cxx:747
 AliITSDetTypeSim.cxx:748
 AliITSDetTypeSim.cxx:749
 AliITSDetTypeSim.cxx:750
 AliITSDetTypeSim.cxx:751
 AliITSDetTypeSim.cxx:752
 AliITSDetTypeSim.cxx:753
 AliITSDetTypeSim.cxx:754
 AliITSDetTypeSim.cxx:755
 AliITSDetTypeSim.cxx:756
 AliITSDetTypeSim.cxx:757
 AliITSDetTypeSim.cxx:758
 AliITSDetTypeSim.cxx:759
 AliITSDetTypeSim.cxx:760
 AliITSDetTypeSim.cxx:761
 AliITSDetTypeSim.cxx:762
 AliITSDetTypeSim.cxx:763
 AliITSDetTypeSim.cxx:764
 AliITSDetTypeSim.cxx:765
 AliITSDetTypeSim.cxx:766
 AliITSDetTypeSim.cxx:767
 AliITSDetTypeSim.cxx:768
 AliITSDetTypeSim.cxx:769
 AliITSDetTypeSim.cxx:770
 AliITSDetTypeSim.cxx:771
 AliITSDetTypeSim.cxx:772
 AliITSDetTypeSim.cxx:773
 AliITSDetTypeSim.cxx:774
 AliITSDetTypeSim.cxx:775
 AliITSDetTypeSim.cxx:776
 AliITSDetTypeSim.cxx:777
 AliITSDetTypeSim.cxx:778
 AliITSDetTypeSim.cxx:779
 AliITSDetTypeSim.cxx:780
 AliITSDetTypeSim.cxx:781
 AliITSDetTypeSim.cxx:782
 AliITSDetTypeSim.cxx:783
 AliITSDetTypeSim.cxx:784
 AliITSDetTypeSim.cxx:785
 AliITSDetTypeSim.cxx:786
 AliITSDetTypeSim.cxx:787
 AliITSDetTypeSim.cxx:788
 AliITSDetTypeSim.cxx:789
 AliITSDetTypeSim.cxx:790
 AliITSDetTypeSim.cxx:791
 AliITSDetTypeSim.cxx:792
 AliITSDetTypeSim.cxx:793
 AliITSDetTypeSim.cxx:794
 AliITSDetTypeSim.cxx:795
 AliITSDetTypeSim.cxx:796
 AliITSDetTypeSim.cxx:797
 AliITSDetTypeSim.cxx:798
 AliITSDetTypeSim.cxx:799
 AliITSDetTypeSim.cxx:800
 AliITSDetTypeSim.cxx:801
 AliITSDetTypeSim.cxx:802
 AliITSDetTypeSim.cxx:803
 AliITSDetTypeSim.cxx:804
 AliITSDetTypeSim.cxx:805
 AliITSDetTypeSim.cxx:806
 AliITSDetTypeSim.cxx:807
 AliITSDetTypeSim.cxx:808
 AliITSDetTypeSim.cxx:809
 AliITSDetTypeSim.cxx:810
 AliITSDetTypeSim.cxx:811
 AliITSDetTypeSim.cxx:812
 AliITSDetTypeSim.cxx:813
 AliITSDetTypeSim.cxx:814
 AliITSDetTypeSim.cxx:815
 AliITSDetTypeSim.cxx:816
 AliITSDetTypeSim.cxx:817
 AliITSDetTypeSim.cxx:818
 AliITSDetTypeSim.cxx:819
 AliITSDetTypeSim.cxx:820
 AliITSDetTypeSim.cxx:821
 AliITSDetTypeSim.cxx:822
 AliITSDetTypeSim.cxx:823
 AliITSDetTypeSim.cxx:824
 AliITSDetTypeSim.cxx:825
 AliITSDetTypeSim.cxx:826
 AliITSDetTypeSim.cxx:827
 AliITSDetTypeSim.cxx:828
 AliITSDetTypeSim.cxx:829
 AliITSDetTypeSim.cxx:830
 AliITSDetTypeSim.cxx:831
 AliITSDetTypeSim.cxx:832
 AliITSDetTypeSim.cxx:833
 AliITSDetTypeSim.cxx:834
 AliITSDetTypeSim.cxx:835
 AliITSDetTypeSim.cxx:836
 AliITSDetTypeSim.cxx:837
 AliITSDetTypeSim.cxx:838
 AliITSDetTypeSim.cxx:839
 AliITSDetTypeSim.cxx:840
 AliITSDetTypeSim.cxx:841
 AliITSDetTypeSim.cxx:842
 AliITSDetTypeSim.cxx:843
 AliITSDetTypeSim.cxx:844
 AliITSDetTypeSim.cxx:845
 AliITSDetTypeSim.cxx:846
 AliITSDetTypeSim.cxx:847
 AliITSDetTypeSim.cxx:848
 AliITSDetTypeSim.cxx:849
 AliITSDetTypeSim.cxx:850
 AliITSDetTypeSim.cxx:851
 AliITSDetTypeSim.cxx:852
 AliITSDetTypeSim.cxx:853
 AliITSDetTypeSim.cxx:854
 AliITSDetTypeSim.cxx:855
 AliITSDetTypeSim.cxx:856
 AliITSDetTypeSim.cxx:857
 AliITSDetTypeSim.cxx:858
 AliITSDetTypeSim.cxx:859
 AliITSDetTypeSim.cxx:860
 AliITSDetTypeSim.cxx:861
 AliITSDetTypeSim.cxx:862
 AliITSDetTypeSim.cxx:863
 AliITSDetTypeSim.cxx:864
 AliITSDetTypeSim.cxx:865
 AliITSDetTypeSim.cxx:866
 AliITSDetTypeSim.cxx:867
 AliITSDetTypeSim.cxx:868
 AliITSDetTypeSim.cxx:869
 AliITSDetTypeSim.cxx:870
 AliITSDetTypeSim.cxx:871
 AliITSDetTypeSim.cxx:872
 AliITSDetTypeSim.cxx:873
 AliITSDetTypeSim.cxx:874
 AliITSDetTypeSim.cxx:875
 AliITSDetTypeSim.cxx:876
 AliITSDetTypeSim.cxx:877
 AliITSDetTypeSim.cxx:878
 AliITSDetTypeSim.cxx:879
 AliITSDetTypeSim.cxx:880
 AliITSDetTypeSim.cxx:881
 AliITSDetTypeSim.cxx:882
 AliITSDetTypeSim.cxx:883
 AliITSDetTypeSim.cxx:884
 AliITSDetTypeSim.cxx:885
 AliITSDetTypeSim.cxx:886
 AliITSDetTypeSim.cxx:887
 AliITSDetTypeSim.cxx:888
 AliITSDetTypeSim.cxx:889
 AliITSDetTypeSim.cxx:890
 AliITSDetTypeSim.cxx:891
 AliITSDetTypeSim.cxx:892
 AliITSDetTypeSim.cxx:893
 AliITSDetTypeSim.cxx:894
 AliITSDetTypeSim.cxx:895
 AliITSDetTypeSim.cxx:896
 AliITSDetTypeSim.cxx:897
 AliITSDetTypeSim.cxx:898
 AliITSDetTypeSim.cxx:899
 AliITSDetTypeSim.cxx:900
 AliITSDetTypeSim.cxx:901
 AliITSDetTypeSim.cxx:902
 AliITSDetTypeSim.cxx:903
 AliITSDetTypeSim.cxx:904
 AliITSDetTypeSim.cxx:905
 AliITSDetTypeSim.cxx:906
 AliITSDetTypeSim.cxx:907
 AliITSDetTypeSim.cxx:908
 AliITSDetTypeSim.cxx:909
 AliITSDetTypeSim.cxx:910
 AliITSDetTypeSim.cxx:911
 AliITSDetTypeSim.cxx:912
 AliITSDetTypeSim.cxx:913
 AliITSDetTypeSim.cxx:914
 AliITSDetTypeSim.cxx:915
 AliITSDetTypeSim.cxx:916
 AliITSDetTypeSim.cxx:917
 AliITSDetTypeSim.cxx:918
 AliITSDetTypeSim.cxx:919
 AliITSDetTypeSim.cxx:920
 AliITSDetTypeSim.cxx:921
 AliITSDetTypeSim.cxx:922
 AliITSDetTypeSim.cxx:923
 AliITSDetTypeSim.cxx:924
 AliITSDetTypeSim.cxx:925
 AliITSDetTypeSim.cxx:926
 AliITSDetTypeSim.cxx:927
 AliITSDetTypeSim.cxx:928
 AliITSDetTypeSim.cxx:929
 AliITSDetTypeSim.cxx:930
 AliITSDetTypeSim.cxx:931
 AliITSDetTypeSim.cxx:932
 AliITSDetTypeSim.cxx:933
 AliITSDetTypeSim.cxx:934
 AliITSDetTypeSim.cxx:935
 AliITSDetTypeSim.cxx:936
 AliITSDetTypeSim.cxx:937
 AliITSDetTypeSim.cxx:938
 AliITSDetTypeSim.cxx:939
 AliITSDetTypeSim.cxx:940
 AliITSDetTypeSim.cxx:941
 AliITSDetTypeSim.cxx:942
 AliITSDetTypeSim.cxx:943
 AliITSDetTypeSim.cxx:944
 AliITSDetTypeSim.cxx:945
 AliITSDetTypeSim.cxx:946
 AliITSDetTypeSim.cxx:947
 AliITSDetTypeSim.cxx:948
 AliITSDetTypeSim.cxx:949
 AliITSDetTypeSim.cxx:950
 AliITSDetTypeSim.cxx:951
 AliITSDetTypeSim.cxx:952
 AliITSDetTypeSim.cxx:953
 AliITSDetTypeSim.cxx:954
 AliITSDetTypeSim.cxx:955
 AliITSDetTypeSim.cxx:956
 AliITSDetTypeSim.cxx:957
 AliITSDetTypeSim.cxx:958
 AliITSDetTypeSim.cxx:959
 AliITSDetTypeSim.cxx:960
 AliITSDetTypeSim.cxx:961
 AliITSDetTypeSim.cxx:962
 AliITSDetTypeSim.cxx:963
 AliITSDetTypeSim.cxx:964
 AliITSDetTypeSim.cxx:965
 AliITSDetTypeSim.cxx:966
 AliITSDetTypeSim.cxx:967
 AliITSDetTypeSim.cxx:968
 AliITSDetTypeSim.cxx:969
 AliITSDetTypeSim.cxx:970
 AliITSDetTypeSim.cxx:971
 AliITSDetTypeSim.cxx:972
 AliITSDetTypeSim.cxx:973
 AliITSDetTypeSim.cxx:974
 AliITSDetTypeSim.cxx:975
 AliITSDetTypeSim.cxx:976
 AliITSDetTypeSim.cxx:977
 AliITSDetTypeSim.cxx:978
 AliITSDetTypeSim.cxx:979
 AliITSDetTypeSim.cxx:980
 AliITSDetTypeSim.cxx:981
 AliITSDetTypeSim.cxx:982
 AliITSDetTypeSim.cxx:983
 AliITSDetTypeSim.cxx:984
 AliITSDetTypeSim.cxx:985
 AliITSDetTypeSim.cxx:986
 AliITSDetTypeSim.cxx:987
 AliITSDetTypeSim.cxx:988
 AliITSDetTypeSim.cxx:989
 AliITSDetTypeSim.cxx:990
 AliITSDetTypeSim.cxx:991
 AliITSDetTypeSim.cxx:992
 AliITSDetTypeSim.cxx:993
 AliITSDetTypeSim.cxx:994
 AliITSDetTypeSim.cxx:995
 AliITSDetTypeSim.cxx:996
 AliITSDetTypeSim.cxx:997
 AliITSDetTypeSim.cxx:998
 AliITSDetTypeSim.cxx:999
 AliITSDetTypeSim.cxx:1000
 AliITSDetTypeSim.cxx:1001
 AliITSDetTypeSim.cxx:1002
 AliITSDetTypeSim.cxx:1003
 AliITSDetTypeSim.cxx:1004
 AliITSDetTypeSim.cxx:1005
 AliITSDetTypeSim.cxx:1006
 AliITSDetTypeSim.cxx:1007
 AliITSDetTypeSim.cxx:1008
 AliITSDetTypeSim.cxx:1009
 AliITSDetTypeSim.cxx:1010
 AliITSDetTypeSim.cxx:1011
 AliITSDetTypeSim.cxx:1012
 AliITSDetTypeSim.cxx:1013
 AliITSDetTypeSim.cxx:1014
 AliITSDetTypeSim.cxx:1015
 AliITSDetTypeSim.cxx:1016
 AliITSDetTypeSim.cxx:1017
 AliITSDetTypeSim.cxx:1018
 AliITSDetTypeSim.cxx:1019
 AliITSDetTypeSim.cxx:1020
 AliITSDetTypeSim.cxx:1021
 AliITSDetTypeSim.cxx:1022
 AliITSDetTypeSim.cxx:1023
 AliITSDetTypeSim.cxx:1024
 AliITSDetTypeSim.cxx:1025
 AliITSDetTypeSim.cxx:1026
 AliITSDetTypeSim.cxx:1027
 AliITSDetTypeSim.cxx:1028
 AliITSDetTypeSim.cxx:1029
 AliITSDetTypeSim.cxx:1030
 AliITSDetTypeSim.cxx:1031
 AliITSDetTypeSim.cxx:1032
 AliITSDetTypeSim.cxx:1033
 AliITSDetTypeSim.cxx:1034
 AliITSDetTypeSim.cxx:1035
 AliITSDetTypeSim.cxx:1036
 AliITSDetTypeSim.cxx:1037
 AliITSDetTypeSim.cxx:1038
 AliITSDetTypeSim.cxx:1039
 AliITSDetTypeSim.cxx:1040
 AliITSDetTypeSim.cxx:1041
 AliITSDetTypeSim.cxx:1042
 AliITSDetTypeSim.cxx:1043
 AliITSDetTypeSim.cxx:1044
 AliITSDetTypeSim.cxx:1045
 AliITSDetTypeSim.cxx:1046
 AliITSDetTypeSim.cxx:1047
 AliITSDetTypeSim.cxx:1048
 AliITSDetTypeSim.cxx:1049
 AliITSDetTypeSim.cxx:1050
 AliITSDetTypeSim.cxx:1051
 AliITSDetTypeSim.cxx:1052
 AliITSDetTypeSim.cxx:1053
 AliITSDetTypeSim.cxx:1054
 AliITSDetTypeSim.cxx:1055
 AliITSDetTypeSim.cxx:1056
 AliITSDetTypeSim.cxx:1057
 AliITSDetTypeSim.cxx:1058
 AliITSDetTypeSim.cxx:1059
 AliITSDetTypeSim.cxx:1060
 AliITSDetTypeSim.cxx:1061
 AliITSDetTypeSim.cxx:1062
 AliITSDetTypeSim.cxx:1063
 AliITSDetTypeSim.cxx:1064
 AliITSDetTypeSim.cxx:1065
 AliITSDetTypeSim.cxx:1066
 AliITSDetTypeSim.cxx:1067