Skip to Content.
Sympa Menu

sphenix-emcal-l - [Sphenix-emcal-l] Tower building and calibration code

sphenix-emcal-l AT lists.bnl.gov

Subject: sPHENIX EMCal discussion

List archive

Chronological Thread  
  • From: Blair Daniel Seidlitz <blair.daniel.seidlitz AT cern.ch>
  • To: "sphenix-emcal-l AT lists.bnl.gov" <sphenix-emcal-l AT lists.bnl.gov>, "sphenix-hcal-l AT lists.bnl.gov" <sphenix-hcal-l AT lists.bnl.gov>
  • Subject: [Sphenix-emcal-l] Tower building and calibration code
  • Date: Tue, 13 Jun 2023 15:43:13 +0000

Dear all,

As mentioned in the calo calibrations meeting the raw data processing and calibration coresoftware packages are functioning and ready for your battle-testing and general use.  

I have included the Fun4all macro which processes some sample prdfs.  Please contact the experts for which data files would be good to look at for actual studies.  Note, the DST node names may change (especially the calib node) to be compatible with downstream processing, so watch the git or the beginning of the print out when you run the macro.  
/sphenix/u/bseidlitz/work/public/Fun4All_CosmicTree.C

The packages included are the 
CaloTowerBuilder: https://github.com/sPHENIX-Collaboration/coresoftware/blob/master/offline/packages/CaloReco/CaloTowerBuilder.cc
Our big core software repository. Contribute to sPHENIX-Collaboration/coresoftware development by creating an account on GitHub.
github.com

aloTowerCalib: https://github.com/sPHENIX-Collaboration/coresoftware/blob/master/offline/packages/CaloReco/CaloTowerCalib.cc
Our big core software repository. Contribute to sPHENIX-Collaboration/coresoftware development by creating an account on GitHub.
github.com


There are two calibrations available for the EMCal.
  1. A relative pre-calibration from cosmics that preserves the ADC scale.  This runs by default if you choose to calibrate the CEMC detector (see code below). 
  2. A absolute pre-calibration from cosmics that converts to GEV EM scale towers and need to set manually (see code) 
There is only one calibration available for the HCals which each runs by default and are simply the (building 912) pre-installation absolute calibration from ADC to MeV of visible energy deposition (i.e. tower_sim definition).  This is also for the test stand electronics.  Thus this is more of a test of the calibration code and will not render anthing that physically meaningful when using this calibration.    

It should be obvious that these calibrations are unofficial but let me know if you have any issues or the calibration seem to have a discrepancy with what I describe them as being. 

I have put the code at the end of this email, if you just want peruse it. 

Best,
Blair


#ifndef MACRO_FUN4ALL_COSMICTREE_C
#define MACRO_FUN4ALL_COSMICTREE_C

#include <fun4all/SubsysReco.h>
#include <fun4all/Fun4AllServer.h>
#include <fun4all/Fun4AllInputManager.h>
#include <fun4allraw/Fun4AllPrdfInputManager.h>

#include <caloreco/CaloTowerBuilder.h>
#include <caloreco/CaloTowerCalib.h>
#include <caloreco/RawClusterBuilderTemplate.h>

#include <phool/recoConsts.h>

// this is analysis macro that makes a tree which you are welcome to steal
#include </sphenix/u/bseidlitz/work/caloTreeMaker/CosmicTree.h>

R__LOAD_LIBRARY(libfun4all.so)
R__LOAD_LIBRARY(libfun4allraw.so)
R__LOAD_LIBRARY(libcalo_reco.so)

R__LOAD_LIBRARY(libCosmicTree.so)

// this file is a combine ohcal and ihcal prdf
//void Fun4All_CosmicTree(const int nevents = 0, const char *fname = "/sphenix/lustre01/sphnxpro/commissioning/HCal/calib/calib_West-00007421-0000.prdf", const char *outfname = "cosmictree.root")
// this one is a cemc prdf from a single SEB
void Fun4All_CosmicTree(const int nevents = 0, const char *fname = "/sphenix/u/bseidlitz/work/calo_reco/beam_seb07-00009183-0001.prdf", const char *outfname = "cosmictree.root")
{

    Fun4AllServer *se = Fun4AllServer::instance();
    Fun4AllInputManager *in = new Fun4AllPrdfInputManager("in");
    in->fileopen(fname);
    se->registerInputManager(in);

    recoConsts *rc = recoConsts::instance();
    rc->set_StringFlag("CDB_GLOBALTAG","ProdA_2023"); // this points to the global tag in the CDB
    // The calibrations have a validity range set by the beam clock which is not read out of the prdfs as of now
    rc->set_uint64Flag("TIMESTAMP",0);

    bool doEMCal = 1;
    if (doEMCal){
      // This builds the raw TowerInfo node named TOWERS_CEMC
      CaloTowerBuilder *ca = new CaloTowerBuilder("CEMCBUILDER");
      ca->set_detector_type(CaloTowerBuilder::CEMC);
      ca->set_processing_type(CaloWaveformProcessing::FAST);
      ca->set_nsamples(31);
      se->registerSubsystem(ca);

      // This creates TOWERS_Calib_CEMC
      CaloTowerCalib *calib = new CaloTowerCalib("CEMCCALIB");
      //calib->setCalibName("cemc_abscalib_cosmic");// these two lines are needed to choose your own calibration
      //calib->setFieldName("cemc_abscalib_cosmic");
      calib->set_detector_type(CaloTowerCalib::CEMC);
      se->registerSubsystem(calib);

      // this makes a root tree maker
      CosmicTree *ct = new CosmicTree("COHCAL", "cemc_towers.root");
      ct->Detector("CEMC");
      se->registerSubsystem(ct);
    }

    bool doHcal = 0;
    if (doHcal){
      CaloTowerBuilder *ca = new CaloTowerBuilder("HCALOUTBUILDER");
      ca->set_detector_type(CaloTowerBuilder::HCALOUT);
      ca->set_processing_type(CaloWaveformProcessing::FAST);
      ca->set_nsamples(31);
      se->registerSubsystem(ca);
      ca = new CaloTowerBuilder("HCALINBUILDER");
      ca->set_detector_type(CaloTowerBuilder::HCALIN);
      ca->set_processing_type(CaloWaveformProcessing::FAST);
      ca->set_nsamples(31);
      se->registerSubsystem(ca);

      CaloTowerCalib *calib = new CaloTowerCalib("HCALOUTCALIB");
      calib->set_detector_type(CaloTowerCalib::HCALOUT);
      se->registerSubsystem(calib);
      calib = new CaloTowerCalib("HCALINCALIB");
      calib->set_detector_type(CaloTowerCalib::HCALIN);
      se->registerSubsystem(calib);

      CosmicTree *ct = new CosmicTree("COHCAL", "ohcal7421west0.root");
      ct->Detector("HCALOUT");
      se->registerSubsystem(ct);
      ct = new CosmicTree("CIHCAL", "ihcal7421west0.root");
      ct->Detector("HCALIN");
      se->registerSubsystem(ct);
    }

    se->run(nevents);
    se->End();
}

#endif


  • [Sphenix-emcal-l] Tower building and calibration code, Blair Daniel Seidlitz, 06/13/2023

Archive powered by MHonArc 2.6.24.

Top of Page