<commit_before>#ifndef ALIEMCALLOADER_H
#define ALIEMCALLOADER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id$ */

//_________________________________________________________________________
//  A singleton that returns various objects 
//  Should be used on the analysis stage to avoid confusing between different
//  branches of reconstruction tree: e.g. reading RecPoints and TS made from 
//  another set of RecPoints.
// 
//  The objects are retrived from folders.  
//*-- Author: <NAME> (SUBATECH) & <NAME> (RRC KI & SUBATECH)
//    


// --- ROOT system ---
#include "TClonesArray.h"
#include "TFolder.h"  
#include "TTree.h"
class TString ;
class TParticle ;
class TTask ;

// --- Standard library ---

// --- AliRoot header files ---

#include "AliRun.h"
#include "AliRunLoader.h"
#include "AliEMCALDigit.h"
#include "AliEMCALRecPoint.h"
#include "AliEMCALTrackSegment.h"
#include "AliEMCALClusterizer.h"
#include "AliEMCALTrackSegmentMaker.h" 
#include "AliEMCALPID.h"
class AliLoader ;
class AliEMCAL ; 
class AliEMCALHit ;
class AliEMCALRecParticle ; 
class AliEMCALGeometry ;
class AliEMCALDigitizer ; 
class AliEMCALSDigitizer ; 
class AliEMCALCalibrationDB ;


//

class AliEMCALLoader : public AliLoader {
  
 public:

  AliEMCALLoader();
  AliEMCALLoader(const AliEMCALLoader & obj):AliLoader(obj){}
  AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername); 
  
  virtual ~AliEMCALLoader() ; 

  // assignement operator requested by coding convention, but not needed
  const AliEMCALLoader & operator = (const AliEMCALLoader & ) {return *this;}

  Int_t   GetEvent();//extends the method on EMCAL RecPart posting
  Int_t   SetEvent();//extends the method on EMCAL RecPart posting
  
  Bool_t  BranchExists(const TString& recName);
  Int_t   LoadHits(Option_t* opt=""); //reads  from disk and sends them to folder; array as well as tree
  Int_t   LoadSDigits(Option_t* opt="");
  Int_t   LoadDigits(Option_t* opt=""); //reads Digits from disk and sends them to folder; array as well as tree
  Int_t   LoadRecPoints(Option_t* opt=""); //reads RecPoints from disk and sends them to folder; array as well as tree
  Int_t   LoadTracks(Option_t* opt="");  //reads Tracks from disk and sends them to folder; array as well as tree
  Int_t   LoadRecParticles(Option_t* opt="");
 
  void    UnloadRecParticles();
  void    UnloadTracks();
  
  Int_t   PostHits();  //Posts the 
  Int_t   PostSDigits();
  Int_t   PostDigits();
  Int_t   PostRecPoints();
  Int_t   PostTracks();
  Int_t   PostRecParticles();
  
  void    CleanFolders();//cleans all the stuff loaded by this detector + calls AliLoader::Clean

  void    CleanHits();
  void    CleanSDigits();
  void    CleanDigits();
  void    CleanRecPoints();
  void    CleanTracks();
  void    CleanRecParticles();

//up to now it is only here -> no definition about global/incremental tracking/PID
 
//   Int_t   WriteRecParticles(Option_t* opt="");//writes the reconstructed particles
//   Int_t   WritePID(Option_t* opt="");//writes the task for PID to file
//   Bool_t  PostPID  (AliEMCALPID * pid) const {return kTRUE;}

/*******************************************************************/
/*******************************************************************/
/*******************************************************************/

  TObject** HitsRef(){return GetDetectorDataRef(Hits());}
  TObject** SDigitsRef(){return GetDetectorDataRef(SDigits());}
  TObject** DigitsRef(){return GetDetectorDataRef(Digits());}
  TObject** ECARecPointsRef(){return GetDetectorDataRef(ECARecPoints());}
  TObject** TracksRef(){return GetDetectorDataRef(TrackSegments());}
  TObject** RecParticlesRef(){return GetDetectorDataRef(RecParticles());}

  void   Track(Int_t itrack) ;

  static AliEMCALGeometry* GetEMCALGeometry();
  static AliEMCALLoader* GetEMCALLoader(const  char* eventfoldername);

  //Method to be used when digitizing under AliRunDigitizer, who opens all files etc.
  Int_t  EventNumber()       { return (Int_t) GetRunLoader()->GetEventNumber();}
  Int_t  MaxEvent()          { return (Int_t) GetRunLoader()->TreeE()->GetEntries();}

  const AliEMCAL *         EMCAL();
  const AliEMCALGeometry  *EMCALGeometry() ; 

  /*********************************************/
  /************    TClonesArrays     ***********/
  /*********************************************/
  /****   H i t s  ****/
  TClonesArray*  Hits(void);
  const AliEMCALHit*    Hit(Int_t index);
  void MakeHitsArray();
  /****   S D i g i t s  ****/ 
  TClonesArray*  SDigits();
  const AliEMCALDigit*  SDigit(Int_t index);
  void MakeSDigitsArray();
  /****  D i g i t s  ****/
  TClonesArray*   Digits();
  const AliEMCALDigit *  Digit(Int_t index);
  void MakeDigitsArray();
  /****  R e c P o i n t s  ****/
  TObjArray * ECARecPoints();
  const AliEMCALRecPoint * ECARecPoint(Int_t index) ;
  void MakeRecPointsArray();
  /****   T r a c k S e g m e n t s ****/
  TClonesArray * TrackSegments();
  const AliEMCALTrackSegment * TrackSegment(Int_t index);
  void MakeTrackSegmentsArray();
  /****  R e c P a r t ic l e s   ****/
  TClonesArray * RecParticles() ;
  const AliEMCALRecParticle * RecParticle(Int_t index);
  void MakeRecParticlesArray();

  /*********************************************/
  /************    T A S K S      **************/
  /*********************************************/
  // 
  //  AliEMCALSDigitizer*  EMCALSDigitizer(TString name = AliConfig::GetDefaultEventFolderName());
  //AliEMCALDigitizer*   EMCALDigitizer()  { return  dynamic_cast<AliEMCALDigitizer*>(Digitizer()) ;}

  AliEMCALClusterizer* Clusterizer ()  {return dynamic_cast<AliEMCALClusterizer*>(Reconstructioner()) ;}
  Int_t PostClusterizer(TTask* clust){return PostReconstructioner(clust);}
  Int_t LoadClusterizer(Option_t * opt="") {return LoadReconstructioner(opt);}
  Int_t WriteClusterizer(Option_t * opt="") {return WriteReconstructioner(opt);}

  AliEMCALPID * PID (){return dynamic_cast<AliEMCALPID*>(PIDTask()) ;}
  Int_t PostPID(TTask* pid){return PostPIDTask(pid);}
  Int_t LoadPID(Option_t * opt="") {return LoadPIDTask(opt);}
  Int_t WritePID(Option_t * opt="") {return WritePIDTask(opt);}


  AliEMCALTrackSegmentMaker * TrackSegmentMaker ()  { return dynamic_cast<AliEMCALTrackSegmentMaker *>(Tracker()) ;}
  Int_t PostTrackSegmentMaker(TTask* segmaker){return PostTracker(segmaker);}
  Int_t LoadTrackSegmentMaker(Option_t * opt="") {return LoadTracker(opt);}
  Int_t WriteTrackSegmentMaker(Option_t * opt="") {return WriteTracker(opt);}

  
  void   SetDebug(Int_t level) {fDebug = level;} // Set debug level
  void   SetBranchTitle(const TString& btitle);
  
  AliEMCALCalibrationDB * CalibrationDB(){return  fcdb; }
  //void ReadCalibrationDB(const char * name, const char * filename);
  

  static TString HitsName() { return fgkHitsName ; }   //Name for TClonesArray with hits from one event
  static TString SDigitsName() { return fgkSDigitsName ;} //Name for TClonesArray 
  static TString DigitsName() { return fgkDigitsName ;} //Name for TClonesArray 
  static TString ECARecPointsName() { return fgkECARecPointsName ;} //Name for TClonesArray y 
  static TString TracksName() { return fgkTracksName ;} //Name for TClonesArray 
  static TString RecParticlesName() { return fgkRecParticlesName ;} //Name for TClonesArray
  static TString ECARecPointsBranchName() { return fgkECARecPointsBranchName ;} //Name for branch
  static TString TrackSegmentsBranchName() { return fgkTrackSegmentsBranchName ;} //Name for branch
  static TString RecParticlesBranchName() { return fgkRecParticlesBranchName ;} //Name for branch
<commit_msg>Violations corrected<commit_after>#ifndef ALIEMCALLOADER_H
#define ALIEMCALLOADER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id$ */

//_________________________________________________________________________
//  A singleton that returns various objects 
//  Should be used on the analysis stage to avoid confusing between different
//  branches of reconstruction tree: e.g. reading RecPoints and TS made from 
//  another set of RecPoints.
// 
//  The objects are retrived from folders.  
//*-- Author: <NAME> (SUBATECH) & <NAME> (RRC KI & SUBATECH)
//    


// --- ROOT system ---
#include "TClonesArray.h"
#include "TFolder.h"  
#include "TTree.h"
class TString ;
class TParticle ;
class TTask ;

// --- Standard library ---

// --- AliRoot header files ---

#include "AliRun.h"
#include "AliRunLoader.h"
#include "AliEMCALDigit.h"
#include "AliEMCALRecPoint.h"
#include "AliEMCALTrackSegment.h"
#include "AliEMCALClusterizer.h"
#include "AliEMCALTrackSegmentMaker.h" 
#include "AliEMCALPID.h"
class AliLoader ;
class AliEMCAL ; 
class AliEMCALHit ;
class AliEMCALRecParticle ; 
class AliEMCALGeometry ;
class AliEMCALDigitizer ; 
class AliEMCALSDigitizer ; 
class AliEMCALCalibrationDB ;


//

class AliEMCALLoader : public AliLoader {
  
 public:

  AliEMCALLoader();
  AliEMCALLoader(const AliEMCALLoader & obj):AliLoader(obj){}
  AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername); 
  
  virtual ~AliEMCALLoader() ; 

  // assignement operator requested by coding convention, but not needed
  const AliEMCALLoader & operator = (const AliEMCALLoader & ) {return *this;}

  Int_t   GetEvent();//extends the method on EMCAL RecPart posting
  Int_t   SetEvent();//extends the method on EMCAL RecPart posting
  
  Bool_t  BranchExists(const TString& recName);
  Int_t   LoadHits(Option_t* opt=""); //reads  from disk and sends them to folder; array as well as tree
  Int_t   LoadSDigits(Option_t* opt="");
  Int_t   LoadDigits(Option_t* opt=""); //reads Digits from disk and sends them to folder; array as well as tree
  Int_t   LoadRecPoints(Option_t* opt=""); //reads RecPoints from disk and sends them to folder; array as well as tree
  Int_t   LoadTracks(Option_t* opt="");  //reads Tracks from disk and sends them to folder; array as well as tree
  Int_t   LoadRecParticles(Option_t* opt="");
 
  void    UnloadRecParticles();
  void    UnloadTracks();
  
  Int_t   PostHits();  //Posts the 
  Int_t   PostSDigits();
  Int_t   PostDigits();
  Int_t   PostRecPoints();
  Int_t   PostTracks();
  Int_t   PostRecParticles();
  
  void    CleanFolders();//cleans all the stuff loaded by this detector + calls AliLoader::Clean

  void    CleanHits();
  void    CleanSDigits();
  void    CleanDigits();
  void    CleanRecPoints();
  void    CleanTracks();
  void    CleanRecParticles();

//up to now it is only here -> no definition about global/incremental tracking/PID
 
//   Int_t   WriteRecParticles(Option_t* opt="");//writes the reconstructed particles
//   Int_t   WritePID(Option_t* opt="");//writes the task for PID to file
//   Bool_t  PostPID  (AliEMCALPID * pid) const {return kTRUE;}

/*******************************************************************/
/*******************************************************************/
/*******************************************************************/

  TObject** HitsRef(){return GetDetectorDataRef(Hits());}
  TObject** SDigitsRef(){return GetDetectorDataRef(SDigits());}
  TObject** DigitsRef(){return GetDetectorDataRef(Digits());}
  TObject** ECARecPointsRef(){return GetDetectorDataRef(ECARecPoints());}
  TObject** TracksRef(){return GetDetectorDataRef(TrackSegments());}
  TObject** RecParticlesRef(){return GetDetectorDataRef(RecParticles());}

  void   Track(Int_t itrack) ;

  static AliEMCALGeometry* GetEMCALGeometry();
  static AliEMCALLoader* GetEMCALLoader(const  char* eventfoldername);

  //Method to be used when digitizing under AliRunDigitizer, who opens all files etc.
  Int_t  EventNumber()       { return (Int_t) GetRunLoader()->GetEventNumber();}
  Int_t  MaxEvent()          { return (Int_t) GetRunLoader()->TreeE()->GetEntries();}

  const AliEMCAL *         EMCAL();
  const AliEMCALGeometry  *EMCALGeometry() ; 

  /*********************************************/
  /************    TClonesArrays     ***********/
  /*********************************************/
  /****   H i t s  ****/
  TClonesArray*  Hits(void);
  const AliEMCALHit*    Hit(Int_t index);
  void MakeHitsArray();
  /****   S D i g i t s  ****/ 
  TClonesArray*  SDigits();
  const AliEMCALDigit*  SDigit(Int_t index);
  void MakeSDigitsArray();
  /****  D i g i t s  ****/
  TClonesArray*   Digits();
  const AliEMCALDigit *  Digit(Int_t index);
  void MakeDigitsArray();
  /****  R e c P o i n t s  ****/
  TObjArray * ECARecPoints();
  const AliEMCALRecPoint * ECARecPoint(Int_t index) ;
  void MakeRecPointsArray();
  /****   T r a c k S e g m e n t s ****/
  TClonesArray * TrackSegments();
  const AliEMCALTrackSegment * TrackSegment(Int_t index);
  void MakeTrackSegmentsArray();
  /****  R e c P a r t ic l e s   ****/
  TClonesArray * RecParticles() ;
  const AliEMCALRecParticle * RecParticle(Int_t index);
  void MakeRecParticlesArray();

  /*********************************************/
  /************    T A S K S      **************/
  /*********************************************/
  // 
  //  AliEMCALSDigitizer*  EMCALSDigitizer(TString name = AliConfig::GetDefaultEventFolderName());
  //AliEMCALDigitizer*   EMCALDigitizer()  { return  dynamic_cast<AliEMCALDigitizer*>(Digitizer()) ;}

  AliEMCALClusterizer* Clusterizer () const {return dynamic_cast<AliEMCALClusterizer*>(Reconstructioner()) ;}
  Int_t PostClusterizer(TTask* clust) const {return PostReconstructioner(clust);}
  Int_t LoadClusterizer(Option_t * opt="") const {return LoadReconstructioner(opt);}
  Int_t WriteClusterizer(Option_t * opt="") const {return WriteReconstructioner(opt);}

  AliEMCALPID * PID() const {return dynamic_cast<AliEMCALPID*>(PIDTask()) ;}
  Int_t PostPID(TTask* pid) const {return PostPIDTask(pid);}
  Int_t LoadPID(Option_t * opt="") const {return LoadPIDTask(opt);}
  Int_t WritePID(Option_t * opt="") const {return WritePIDTask(opt);}


  AliEMCALTrackSegmentMaker * TrackSegmentMaker () const  { return dynamic_cast<AliEMCALTrackSegmentMaker *>(Tracker()) ;}
  Int_t PostTrackSegmentMaker(TTask* segmaker) const {return PostTracker(segmaker);}
  Int_t LoadTrackSegmentMaker(Option_t * opt="") const {return LoadTracker(opt);}
  Int_t WriteTrackSegmentMaker(Option_t * opt="") const  {return WriteTracker(opt);}

  
  void   SetDebug(Int_t level) {fDebug = level;} // Set debug level
  void   SetBranchTitle(const TString& btitle);
  
  AliEMCALCalibrationDB * CalibrationDB(){return  fcdb; }
  //void ReadCalibrationDB(const char * name, const char * filename);
  

  static TString HitsName() { return fgkHitsName ; }   //Name for TClonesArray with hits from one event
  static TString SDigitsName() { return fgkSDigitsName ;} //Name for TClonesArray 
  static TString DigitsName() { return fgkDigitsName ;} //Name for TClonesArray 
  static TString ECARecPointsName() { return fgkECARecPointsName ;} //Name for TClonesArray y 
  static TString TracksName() { return fgkTracksName ;} //Name for TClonesArray 
  static TString RecParticlesName() { return fgkRecParticlesName ;} //Name for TClonesArray
  static TString ECARecPointsBranchName() { return fgkECARecPointsBranchName ;} //Name for branch
  static TString TrackSegmentsBranchName() { return fgkTrackSegmentsBranchName ;} //Name for branch
  static TString RecParticlesBranchName() { return fgkRecParticlesBranchName ;} //Name for branch

{'fraction_non_alphanumeric': 0.16400412264880185, 'fraction_numerical': 0.001030662200463798, 'mean_word_length': 4.437828371278459, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7423069', 'n_tokens_mistral': 5117, 'n_tokens_neox': 4906, 'n_words': 1302}