]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONChamberCalibrationTask.cxx
Fixing previous change, empty argument macros not supported everywhere
[u/mrichter/AliRoot.git] / MUON / AliMUONChamberCalibrationTask.cxx
index 7bc6237e8f7fdf0050fe80d47b03402d53bfaee3..b3de1395ef25e2692634c0ee4822dee2a9d0d921 100644 (file)
@@ -76,22 +76,21 @@ ClassImp( AliMUONChamberCalibrationTask )
 //______________________________________________________________
 AliMUONChamberCalibrationTask::AliMUONChamberCalibrationTask():
   AliAnalysisTaskSE( "AliMUONChamberCalibrationTask" ),
+  fOCDBPath( "local://$ALICE_ROOT/OCDB" ),
   fCalibChoice(NOGAIN),
-  fCalibData(0x0),
   fClusterInfoTree(0x0),
+  fMuonRecoParam(0x0),
+  fClusterInfo(0x0),
+  fCalibData(0x0),
+  fESDInterface(0x0),
   fDigitStore(0x0),
   fESDInputHandler(0x0),
-  fESDInputEvent(0x0),
-  fMuonRecoParam(0x0),
-  fOCDBPath( "local://$ALICE_ROOT/OCDB" )
+  fESDInputEvent(0x0)
 {
   //
   /// Default constructor
   //
 
-  fClusterInfo = new AliMUONClusterInfo();
-  fESDInterface = new AliMUONESDInterface();
-
 }
 
 //______________________________________________________________
@@ -99,19 +98,21 @@ AliMUONChamberCalibrationTask::AliMUONChamberCalibrationTask( const char* name,
                                                              char* ocdbpath,
                                                              const Int_t my_calib_option ):
   AliAnalysisTaskSE( name ),
-  fCalibData(0x0),
+  fOCDBPath( "local://$ALICE_ROOT/OCDB" ),
+  fCalibChoice(NOGAIN),
   fClusterInfoTree(0x0),
+  fMuonRecoParam(0x0),
+  fClusterInfo(0x0),
+  fCalibData(0x0),
+  fESDInterface(0x0),
   fDigitStore(0x0),
   fESDInputHandler(0x0),
-  fESDInputEvent(0x0),
-  fMuonRecoParam(0x0)
+  fESDInputEvent(0x0)
 {
   //
   /// constructor
   //
 
-  fClusterInfo = new AliMUONClusterInfo();
-  fESDInterface = new AliMUONESDInterface();
   fOCDBPath = ocdbpath;
   if ( (my_calib_option >= ((Int_t)NOGAIN)) && (my_calib_option <= ((Int_t)INJECTIONGAIN)) ) 
     fCalibChoice = (Calibration_t)my_calib_option;
@@ -129,9 +130,9 @@ AliMUONChamberCalibrationTask::~AliMUONChamberCalibrationTask()
   /// destructor
   //
 
-  if ( fMuonRecoParam ) delete fMuonRecoParam;
-  if ( fClusterInfo ) delete fClusterInfo;
-  if ( fESDInterface ) delete fESDInterface;
+  delete fMuonRecoParam;
+  delete fClusterInfo;
+  delete fESDInterface;
 
 }
 //______________________________________________________________
@@ -156,18 +157,24 @@ void AliMUONChamberCalibrationTask::LocalInit()
 {
   //
   /// Initialization
+  /// Initialize the cluster info and the ESD interface
   /// Set the magnetic field, the mapping and the reconstruction parameters
   //
 
   AliDebug( 1, "" );
 
+  // initialize the cluster info and the ESD interface
+
+  fClusterInfo = new AliMUONClusterInfo();
+  fESDInterface = new AliMUONESDInterface();
+
   gRandom->SetSeed(0);
   
   // set mag field
 
   if ( !TGeoGlobalMagField::Instance()->GetField() ) {
     AliInfo( "Loading field map..." );
-    AliMagF* field = new AliMagF( "Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG );
+    AliMagF* field = new AliMagF( "Maps","Maps", 1., 1., AliMagF::k5kG );
     TGeoGlobalMagField::Instance()->SetField( field );
     TGeoGlobalMagField::Instance()->Lock();
   }
@@ -177,10 +184,9 @@ void AliMUONChamberCalibrationTask::LocalInit()
   AliCDBManager* man = AliCDBManager::Instance();
   man->SetDefaultStorage( fOCDBPath );
   man->SetSpecificStorage( "MUON/Calib/MappingData", fOCDBPath );
-  man->SetSpecificStorage( "MUON/Calib/Mapping", fOCDBPath );
-  man->SetSpecificStorage( "MUON/Calib/DDLStore", fOCDBPath );
-  man->Print();
+  man->SetSpecificStorage( "MUON/Calib/MappingRunData", fOCDBPath ); // for the manu serial numbers
   man->SetRun(0);
+  man->Print();
   if ( ! AliMpCDB::LoadDDLStore() ) {
     AliFatal( "Could not access mapping from OCDB !" );
     exit(-1); 
@@ -240,17 +246,16 @@ void AliMUONChamberCalibrationTask::ConnectInputData( Option_t* /*option*/ )
 
       AliFatal( "Could not get input ESD event !!! ");
 
-    } else {
+    } 
+  } else {
 
       AliError( "Could not get input ESD handler !!!" );
       // If no input event handler we need to get the tree once
       // from input slot 0 for the chain
       tree = dynamic_cast<TTree*> (GetInputData(0));
       if ( tree ) tree->GetReadEntry();
-      else AliError( "Could not read tree from input slot 0 !!!" );
+      else AliFatal( "Could not read tree from input slot 0 !!!" );
     }
-  }
-
 }
 
 //______________________________________________________________
@@ -362,8 +367,8 @@ void AliMUONChamberCalibrationTask::Exec( Option_t* /*option*/ )
                             ped->ValueAsFloatFast(manuChannel,1) ); // sigma
        padInfo.SetGain( gain->ValueAsFloatFast(manuChannel,0), // a0
                         gain->ValueAsFloatFast(manuChannel,1), // a1
-                        gain->ValueAsFloatFast(manuChannel,2), // threshold
-                        gain->ValueAsFloatFast(manuChannel,3) ); // fit quality
+                        (Int_t)gain->ValueAsFloatFast(manuChannel,2), // threshold
+                        (Int_t)gain->ValueAsFloatFast(manuChannel,3) ); // fit quality
        
        fClusterInfo->AddPad( padInfo );
       }
@@ -405,5 +410,9 @@ UInt_t AliMUONChamberCalibrationTask::BuildClusterMap( AliMUONTrack &track )
 //______________________________________________________________
 void AliMUONChamberCalibrationTask::Terminate( Option_t* /*option*/ )
 {
+  //
+  /// Called once per task on the client machine at the end of the analysis.
+  //
+
   AliDebug( 1, "" );
 }