Frequently asked questions (FAQ)

How do I create and compile my own Marlin processor in the CALICE software framework?

Download the package calice_torso from here: CALICE DESY-HCAL-group software repositories. The package contains a 'Hello world' example processor. From this, you can start to develop your own processor.

How do I view the CALICE data base?

With the data base viewer dbview.

How do I display events?

We have a processor which is based on the CED event display (supported by ILC core software developers), which displays events in AHCAL and TCMT (no ECAL in the moment). It is called EventDisplayProcessor and it is available in the calice_hh_proc package, developed at DESY Hamburg. You can dowload the package from the CALICE DESY-HCAL-group software repositories. You can find the documentation of the processor here.

How do I get rid of the empty cdb.log file?

You've probably noticed that everytime you run Marlin, you get an empty file, called cdb.log. This is an output from the CondDBMySQL package. You can get rid of it by redirecting the output (thank you Beni for the tip):
export COND_DB_DEBUGLOG=/dev/stdout

How do I get the AHCal module/chip/channel with the new AHCal reconstruction classes?

As of June 2010, we have a new AHCal reconstruction chain. As a result, the cell ID1 is not filled anymore. Previously, this was used to extract the module/chip/channel with the HcalTileIndex class. This information is also available now, by using the new mapper classes developed by B. Lutz.

First, you need to include in the header file of your processor:

#include "AhcMapper.hh"
............
const AhcMapper* _ahcMapper; //this is the AHCal specific mapper
std::string _mappingProcessorName;   //name of the MappingProcessor which provides the mapper

Then in the source file of your processor:

//---------------------------------------------------------
//in the beginning:
#include "MappingProcessor.hh"

//---------------------------------------------------------
//in the constructor:
registerProcessorParameter( "MappingProcessorName" ,
                                            "Name of the MappingProcessor instance that provides the geometry of the detector." ,
                                          _mappingProcessorName, 
                                           std::string("MyMappingProcessor") ) ;
//---------------------------------------------------------

//in the source file
using namespace CALICE;

//in the init() function
void YourProcessor::init()
{
 std::stringstream message;
  bool error=false;

 _ahcMapper = dynamic_cast<const AhcMapper*>(MappingProcessor::getMapper(_mappingProcessorName));
if (!_ahcMapper)
 {
  //protect yourself from this case, for example like this
   message << "MappingProcessor::getMapper("<< _mappingProcessorName
                 << ") did not return a valid mapper." << endl;
   error = true;
  }

if (error)
     {
           m_out(ERROR) << message.str();
           throw marlin::StopProcessingException(this);
    }
}
//---------------------------------------------------------
//in the processEvent() function
void YourProcessor::processEvent(LCEvent *evt)
{
//loop over CalorimeterHits
 CalorimeterHit *hit = ...
 const int cellID = hit->getCellID0();
 const unsigned int module  = _ahcMapper->getModuleFromCellID(cellID);
 const unsigned int chip       = _ahcMapper->getChipFromCellID(cellID);
 const unsigned int channel = _ahcMapper->getChanFromCellID(cellID)
}

This of course works only if you call the MappingProcessor in your steering file, before your processor. If you don't know what steering parameters to set, just look at the example steering file created by:

calice_run/generateRecoXML yourRunNumber

By the way, you can find more interesting and useful functions in the DESY AHCal doxygen documentation

How do I get the AHCAL amplitudes in different units?

To get the AHCAL amplitude in different units, you may use the AhcAmplitude class, which implements:


getAmplRawADC();               //raw amplitude, in ADC units
getAmplRawMinusPedestalADC();  //raw amplitude minus pedestal, in ADC units
getAmplTemperatureCorrMIP();   //amplitude in MIPs (i.e. raw/MIP, before saturation correction), where the MIP 
                               //constant was temperature corrected
getAmplNOTTemperatureCorrMIP();//amplitude in MIPs (i.e. raw/MIP, before saturation correction), where the MIP 
                               //constant was NOT temperature corrected
getAmplGeV();                  //amplitude in GeV (after whole calibration chain, i.e. after saturation)

For every CalorimeterHit, a corresponding collection of AhcAmplitude object is saved in the reconstructed LCIO file. Since you may do a preselection of the calorimeter hits, every amplitude is uniquely related to its AhcAmplitude via an LCRelation. For an example access, please see below:

 //_hitAmplRelationColName: the name of the LCRelation collection (default: AhcHitAmplitudeRelation)
    LCCollection *relCol = evt->getCollection(_hitAmplRelationColName);
     if( relCol == 0 ) {
       m_out( WARNING ) << "No relation named "<<_hitAmplRelationColName<<" found" << endl;
       return ;
     }
 
     LCRelationNavigator relNav(relCol);
 
     LCCollection *hitCol = NULL;
     try
      {
         //_ahcHitColName: name of the AHCAL collection of CalorimeterHits (default: AhcCalorimeter_Hits)
         hitCol = evt->getCollection(_ahcHitColName);
       }
     catch (DataNotAvailableException &e)
       {
         m_out(WARNING)<< "missing collection "
                       <<_ahcHitColName<<endl<<e.what()<<endl;
         return;
       }
     
     for (int i = 0; i < hitCol->getNumberOfElements(); ++i)
       {
         CalorimeterHit *hit = dynamic_cast<CalorimeterHit*>(hitCol->getElementAt(i));
         const LCObjectVec &amplVec = relNav.getRelatedToObjects(hit);
         if (amplVec.size() > 0) 
           {     
             AhcAmplitude *ahcAmpl = dynamic_cast<AhcAmplitude*>(amplVec[0]);
             float amplGeV = ahcAmpl->getAmplGeV();
             m_out(DEBUG0)<<" ampl[GeV] = "<<amplGeV<<endl;
           } 
       }
    
   

-- AngelaLucaciTimoce - 05-Jul-2010

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r7 - 2010-07-05 - AngelaLucaciTimoceExternal
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CALICE All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback