2 removed + 12 modified, total 14 files
slicPandora/src
diff -u -r1.12 -r1.13
--- PfoProcessor.cpp 8 Jun 2010 21:43:02 -0000 1.12
+++ PfoProcessor.cpp 8 Jun 2010 22:12:41 -0000 1.13
@@ -1,4 +1,4 @@
-// $Id: PfoProcessor.cpp,v 1.12 2010/06/08 21:43:02 jeremy Exp $
+// $Id: PfoProcessor.cpp,v 1.13 2010/06/08 22:12:41 jeremy Exp $
#include "PfoProcessor.h"
// lcio
@@ -28,9 +28,6 @@
using std::cout;
using std::endl;
-// Uncomment for debugging output.
-// #define PFOPROCESSOR_DEBUG 1
-
PfoProcessor::PfoProcessor()
: EventProcessor("PfoProcessor")
{}
@@ -143,7 +140,7 @@
pReconstructedParticle->setCharge((*itPFO)->GetCharge());
pReconstructedParticle->setType((*itPFO)->GetParticleId());
- //temporary variables to access the track momentum...
+ // Temporary variables to access the track momentum.
DetectorGeometry* detector = getJobManager()->getDetectorGeometry();
PandoraApi::Geometry::Parameters* pandoraGeomParams = detector->getGeometryParameters();
double magneticField = pandoraGeomParams->m_bField.Get();
@@ -156,39 +153,45 @@
double pz = 0.;
double pT = 0.;
double energy = 0.;
- if (trackAddressList.size()>1) std::cout << " PFO has "<< trackAddressList.size() << std::endl;
+#ifdef PFOPROCESSOR_DEBUG
+ if (trackAddressList.size()>1) std::cout << " PFO has "<< trackAddressList.size() " tracks." << std::endl;
+#endif
// Associate the Tracks with the ReconstructedParticles.
for (pandora::TrackAddressList::iterator itTrack = trackAddressList.begin(), itTrackEnd = trackAddressList.end();
itTrack != itTrackEnd;
++itTrack)
{
#ifdef PFOPROCESSOR_DEBUG
- std::cout << "adding track to RP" << std::endl;
+ std::cout << "Adding track to RP." << std::endl;
#endif
+
+ // Compute track momentum and energy from LCIO Track parameters.
Track* t = (Track*) (*itTrack);
double omega = t->getOmega();
double phi = t->getPhi();
double tanLambda = t->getTanLambda();
- pT = fabs(1./omega)*magneticField*fieldConversion;
- px = pT*cos(phi);
- py = pT*sin(phi);
- pz = pT*tanLambda;
- energy = sqrt(px*px+py*py+pz*pz+(*itPFO)->GetMass()*(*itPFO)->GetMass());
+ pT = fabs(1./omega) * magneticField * fieldConversion;
+ px = pT * cos(phi);
+ py = pT * sin(phi);
+ pz = pT * tanLambda;
+ energy = sqrt(px * px + py * py + pz * pz + (*itPFO)->GetMass() * (*itPFO)->GetMass());
momentum[0] = px;
momentum[1] = py;
momentum[2] = pz;
#ifdef PFOPROCESSOR_DEBUG
- std::cout << "track (px, py, pz) : (" << px << ", " << py << ", " << pz << ")" << std::endl;
+ std::cout << " track (px, py, pz) : (" << px << ", " << py << ", " << pz << ")" << std::endl;
#endif
+ // Add the Track to the output LCIO ReconstructedParticle.
pReconstructedParticle->addTrack(t);
}
- // TODO Understand why this is necessary.
- // Some oddness in the PFO, seems PFOs with tracks do not have either their momentum
- // or their energy correctly set. Override with information from the track.
+ // PFOs with tracks do not have either their momentum or their energy correctly set.
+ // Override with information from the track.
+ // TODO Understand why this is happening.
+ // FIXME What happens in the case of > 1 Track? Can this happen at all?
if(trackAddressList.size() !=0)
{
pReconstructedParticle->setMomentum(momentum);
slicPandora/src
diff -u -r1.6 -r1.7
--- SimpleTrackProcessor.cpp 8 Jun 2010 21:43:02 -0000 1.6
+++ SimpleTrackProcessor.cpp 8 Jun 2010 22:12:41 -0000 1.7
@@ -25,12 +25,8 @@
using UTIL::LCRelationNavigator;
using pandora::CartesianVector;
-// Uncomment for debugging output.
-//#define SIMPLETRACKPROCESSOR_DEBUG 1
-
-// FIXME: Name of collection containing LCIO Track objects is hard-coded to "Tracks".
+// FIXME Name of collection containing LCIO Track objects is hard-coded to "Tracks".
std::string SimpleTrackProcessor::trackCollectionName = "Tracks";
-
std::string SimpleTrackProcessor::startCollectionName = trackCollectionName + "_StateAtStart";
std::string SimpleTrackProcessor::ecalCollectionName = trackCollectionName + "_StateAtECal";
std::string SimpleTrackProcessor::endCollectionName = trackCollectionName + "_StateAtEnd";
@@ -42,7 +38,9 @@
int ntracks = trackCollection->getNumberOfElements();
for (int i=0; i<ntracks; i++)
{
- //std::cout << "proc track #" << i << std::endl;
+#ifdef SIMPLETRACKPROCESSOR_DEBUG
+ std::cout << "proc track #" << i << std::endl;
+#endif
Track* track = dynamic_cast<Track*>(trackCollection->getElementAt(i));
@@ -137,7 +135,7 @@
/**
* LCRelations read from LCSim do NOT work. Don't call this! Left here for reference.
- * FIXME: Can't read relations from LCSim into slicPandora.
+ * FIXME Can't read relations from LCSim into slicPandora.
*/
void SimpleTrackProcessor::setupTrackStatesFromRelations(PandoraApi::Track::Parameters& trackParameters, EVENT::LCEvent* event)
{
@@ -163,8 +161,6 @@
startObj->getFloatVal(4),
startObj->getFloatVal(5));
- //std::cout << "got track state X: " << trackParameters.m_trackStateAtStart.Get().GetPosition().GetX() << std::endl;
-
// Add ECal state.
const LCObjectVec& ecalCollection = navEcal.getRelatedToObjects(track);
LCGenericObject* ecalObj = dynamic_cast<LCGenericObject*>(ecalCollection.at(0));
slicPandora/src
diff -N CalorimeterHitMaker.cpp
--- CalorimeterHitMaker.cpp 9 Mar 2010 20:13:42 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,95 +0,0 @@
-/*
- * File: CalorimeterHitMaker.cpp
- * Author: Norman A. Graf
- *
- * Created on December 2, 2009, 5:45 AM
- */
-
-#include "CalorimeterHitMaker.h"
-
-#include "EVENT/LCIO.h"
-#include "EVENT/LCCollection.h"
-#include "IMPL/LCCollectionVec.h"
-#include "IMPL/CalorimeterHitImpl.h"
-#include "IMPL/LCRelationImpl.h"
-#include "IMPL/LCFlagImpl.h"
-#include "EVENT/SimCalorimeterHit.h"
-
-
-using lcio::LCCollection;
-using lcio::LCIO;
-using lcio::SimCalorimeterHit;
-using IMPL::LCCollectionVec;
-using IMPL::CalorimeterHitImpl;
-using IMPL::LCRelationImpl;
-using IMPL::LCFlagImpl;
-
-using std::cout;
-using std::endl;
-
-CalorimeterHitMaker::CalorimeterHitMaker()
-{
-}
-
-CalorimeterHitMaker::CalorimeterHitMaker(const CalorimeterHitMaker& orig)
-{
-}
-
-CalorimeterHitMaker::~CalorimeterHitMaker()
-{}
-
-void CalorimeterHitMaker::processEvent(lcio::LCEvent* event)
-{
- double SF1 = .0175;
- double SF2 = .00936;
- // get the input SimCalorimeterHits
- LCCollection* simCalHits = event->getCollection("EcalBarrelHits");
- cout << " event has " << simCalHits->getNumberOfElements() << " SimCalorimeterHits";
- //create a container for the output CalorimeterHits
- LCCollectionVec* calHits = new LCCollectionVec(LCIO::CALORIMETERHIT);
- // set the flag to indicate that the position will be stored with the hit.
- LCFlagImpl chFlag(0);
- chFlag.setBit(LCIO::CHBIT_LONG);
-
- calHits->setFlag(chFlag.getFlag());
-
-
- // now convert...
- LCCollectionVec* scRel = new LCCollectionVec(LCIO::LCRELATION);
- scRel->parameters().setValue("RelationFromType", LCIO::CALORIMETERHIT);
- scRel->parameters().setValue("RelationToType", LCIO::SIMCALORIMETERHIT);
-
- int nSimHits = simCalHits->getNumberOfElements();
- for (int j = 0; j < nSimHits; j++)
- {
-
- CalorimeterHitImpl* calHit = new CalorimeterHitImpl;
- SimCalorimeterHit* simcalHit = dynamic_cast<SimCalorimeterHit*> (simCalHits->getElementAt(j));
-
- // std::cout << " adding new calorimeter hit and relation : " << j << " : " << calHit << " - " << simcalHit << std::endl ;
- int layer = (simcalHit->getCellID0() >> 13) & 0x7f;
- double cfac = (layer < 21 ? SF1 : SF2);
- calHit->setEnergy(simcalHit->getEnergy() / cfac);
- calHit->setCellID0(simcalHit->getCellID0());
- calHit->setCellID1(simcalHit->getCellID1());
- calHit->setTime(simcalHit->getTimeCont(0));
- calHit->setPosition(simcalHit->getPosition());
-
- // scRel->addRelation( calHit , simcalHit , 0.5 ) ;
- // scRel->addRelation( calHit , simcalHit , 0.5 ) ;
- scRel->addElement(new LCRelationImpl(calHit, simcalHit, 0.5));
- scRel->addElement(new LCRelationImpl(calHit, simcalHit, 0.5));
- scRel->addElement(new LCRelationImpl(calHit, simcalHit, 0.5));
- calHits->addElement(calHit);
-
- // // create a copy of sim hit and modify it
- // SimCalorimeterHitImpl* mSimHit = new SimCalorimeterHitImpl( *simcalHit ) ;
- // mSimHit->setEnergy( mSimHit->getEnergy() * 1000. ) ;
- // modifiedSimCalHits->addElement( mSimHit ) ;
-
- }
- event->addCollection(calHits, "CalorimeterHits");
-
-}
-
-
slicPandora/include
diff -u -r1.1 -r1.2
--- ClusterShapes.h 21 May 2010 21:12:48 -0000 1.1
+++ ClusterShapes.h 8 Jun 2010 22:12:41 -0000 1.2
@@ -11,18 +11,12 @@
#include <math.h>
/**
- * Utility class to derive properties of clusters, such as centre of gravity,
- * axes of inertia, fits of the cluster shape and so on. All the details are
- * explained in the documentation of the methods. Several classes of the GSL
- * (GNU Scientific Library) are needed in this class.
+ * Ported from MarlinUtil. Only took findGravity() and getCentreOfGravity() functions.
+ * There is no GSL dependency.
+ * --JM
*
* @authors V. Morgunov (ITEP/DESY), A. Raspereza (DESY), O. Wendt (DESY)
- * @version $Id: ClusterShapes.h,v 1.1 2010/05/21 21:12:48 jeremy Exp $
- *
- * --
- *
- * Ported from MarlinUtil. Only took findGravity() / getCentreOfGravity() code.
- * No GSL dependency. --JM
+ * @version $Id: ClusterShapes.h,v 1.2 2010/06/08 22:12:41 jeremy Exp $
*
*/
class ClusterShapes
slicPandora/include
diff -u -r1.2 -r1.3
--- DefaultProcessors.h 17 Mar 2010 02:13:04 -0000 1.2
+++ DefaultProcessors.h 8 Jun 2010 22:12:41 -0000 1.3
@@ -1,6 +1,10 @@
#ifndef DEFAULTPROCESSORS_H
#define DEFAULTPROCESSORS_H 1
+/**
+ * List of default slicPandora Processor headers.
+ */
+
// slicPandora
#include "CalorimeterHitProcessor.h"
#include "EventMarkerProcessor.h"
slicPandora/include
diff -u -r1.12 -r1.13
--- DetectorGeometry.h 7 Jun 2010 22:43:21 -0000 1.12
+++ DetectorGeometry.h 8 Jun 2010 22:12:41 -0000 1.13
@@ -1,4 +1,4 @@
-// $Id: DetectorGeometry.h,v 1.12 2010/06/07 22:43:21 jeremy Exp $
+// $Id: DetectorGeometry.h,v 1.13 2010/06/08 22:12:41 jeremy Exp $
#ifndef DetectorGeometry_h
#define DetectorGeometry_h 1
@@ -11,6 +11,11 @@
class IDDecoder;
+/**
+ * Encapsulates the detector geometry including Pandora's geometry parameters,
+ * as well as various extras necessary to load Pandora geometry files generated
+ * by GeomConverter.
+ */
class DetectorGeometry
{
slicPandora/include
diff -u -r1.1 -r1.2
--- EventMarkerProcessor.h 9 Mar 2010 20:13:42 -0000 1.1
+++ EventMarkerProcessor.h 8 Jun 2010 22:12:41 -0000 1.2
@@ -1,10 +1,13 @@
-// $Id: EventMarkerProcessor.h,v 1.1 2010/03/09 20:13:42 jeremy Exp $
+// $Id: EventMarkerProcessor.h,v 1.2 2010/06/08 22:12:41 jeremy Exp $
#ifndef EVENTMARKERPROCESSOR_H
#define EVENTMARKERPROCESSOR_H 1
#include "EventProcessor.h"
+/**
+ * Prints the event number for each event processed.
+ */
class EventMarkerProcessor : public EventProcessor
{
public:
slicPandora/include
diff -u -r1.4 -r1.5
--- JobConfig.h 11 Mar 2010 22:18:44 -0000 1.4
+++ JobConfig.h 8 Jun 2010 22:12:41 -0000 1.5
@@ -1,4 +1,4 @@
-// $Id: JobConfig.h,v 1.4 2010/03/11 22:18:44 jeremy Exp $
+// $Id: JobConfig.h,v 1.5 2010/06/08 22:12:41 jeremy Exp $
#ifndef JOBCONFIG_H
#define JOBCONFIG_H 1
@@ -7,7 +7,7 @@
#include <vector>
/**
- * JobConfig contains all the parameters for running Pandora jobs using the JobManager.
+ * JobConfig contains the parameters for running Pandora jobs using the JobManager.
*/
class JobConfig
{
@@ -51,88 +51,142 @@
return m_pandoraSettingsXmlFile;
}
+ /**
+ * Set the path to the input Pandora geometry file generated by GeomConverter.
+ */
inline void setGeometryFile(const char* geometryFile)
{
m_geometryFile = std::string(geometryFile);
}
+ /**
+ * Set the path to the input Pandora geometry file generated by GeomConverter.
+ */
inline void setGeometryFile(std::string geometryFile)
{
m_geometryFile = geometryFile;
}
+ /**
+ * Get the path to the geometry file.
+ */
const std::string& getGeometryFile() const
{
return m_geometryFile;
}
+ /**
+ * Add an input LCIO file.
+ */
inline void addInputFile(const char* filename)
{
m_inputLcioFiles.push_back(std::string(filename));
}
+ /**
+ * Add an input LCIO file.
+ */
inline void addInputFile(std::string filename)
{
m_inputLcioFiles.push_back(filename);
}
-
+
+ /**
+ * Get the list of input files.
+ */
const FileList getInputFiles() const
{
return m_inputLcioFiles;
}
+ /**
+ * Set the LCIO output file path.
+ */
inline void setOutputFile(const char* outputFile)
{
m_outputFile = std::string(outputFile);
}
+ /**
+ * Set the LCIO output file path.
+ */
inline void setOutputFile(std::string outputFile)
{
m_outputFile = outputFile;
}
+ /**
+ * Get the LCIO output file path.
+ */
inline const std::string& getOutputFile() const
{
return m_outputFile;
}
+ /**
+ * Set the maximum number of events to process.
+ */
inline void setNumberOfEvents(int nevents)
{
m_nevents = nevents;
}
+ /**
+ * Get the maximum number of events to process.
+ */
inline const int getNumberOfEvents() const
{
return m_nevents;
}
+ /**
+ * Set the number of events to skip.
+ */
inline void setSkipEvents(int nskip)
{
m_nskip = nskip;
}
+ /**
+ * Get the number of events to skip.
+ */
inline int getSkipEvents() const
{
return m_nskip;
}
+ /**
+ * Get a list of calorimeter types.
+ */
const CalorimeterTypes getCalorimeterTypes() const
{
return m_calTypes;
}
+ /**
+ * Add a CalorimeterType.
+ */
inline void addCalorimeterType(const char* calType)
{
m_calTypes.push_back(std::string(calType));
}
+ /**
+ * Add a CalorimeterType.
+ */
inline void addCalorimeterType(std::string calType)
{
m_calTypes.push_back(calType);
}
+ /**
+ * Setup to use the default CalorimeterTypes list.
+ */
void useDefaultCalorimeterTypes();
+ /**
+ * Get the default CalorimeterTypes list.
+ */
inline CalorimeterTypes getDefaultCalorimeterTypes();
private:
slicPandora/include
diff -u -r1.7 -r1.8
--- JobManager.h 11 Mar 2010 22:18:44 -0000 1.7
+++ JobManager.h 8 Jun 2010 22:12:42 -0000 1.8
@@ -1,4 +1,4 @@
-// $Id: JobManager.h,v 1.7 2010/03/11 22:18:44 jeremy Exp $
+// $Id: JobManager.h,v 1.8 2010/06/08 22:12:42 jeremy Exp $
#ifndef JobManager_h
#define JobManager_h 1
@@ -20,7 +20,9 @@
*/
class JobManager
{
+
public:
+
/**
* A list of EventProcessors.
*/
slicPandora/include
diff -u -r1.1 -r1.2
--- PandoraProcessor.h 5 Mar 2010 01:35:48 -0000 1.1
+++ PandoraProcessor.h 8 Jun 2010 22:12:42 -0000 1.2
@@ -7,6 +7,9 @@
// lcio
#include "EVENT/LCEvent.h"
+/**
+ * Calls ProcessEvent to activate Pandora on an event.
+ */
class PandoraProcessor : public EventProcessor
{
public:
slicPandora/include
diff -u -r1.3 -r1.4
--- PfoProcessor.h 11 Mar 2010 22:18:44 -0000 1.3
+++ PfoProcessor.h 8 Jun 2010 22:12:42 -0000 1.4
@@ -1,4 +1,4 @@
-// $Id: PfoProcessor.h,v 1.3 2010/03/11 22:18:44 jeremy Exp $
+// $Id: PfoProcessor.h,v 1.4 2010/06/08 22:12:42 jeremy Exp $
#ifndef PFOPROCESSOR_H
#define PFOPROCESSOR_H 1
@@ -10,6 +10,10 @@
/**
* This event processor converts Pandora PFO objects into LCIO output.
+ * In the process, it also creates LCIO Cluster's from the Pandora clusters.
+ * For neutral particles without a track association, the energy is set correctly
+ * in the Pandora PFO. But for PFOs with associated charged tracks, the energy
+ * is not set correctly. So the associated track is used to set this.
*/
class PfoProcessor : public EventProcessor
{
slicPandora/include
diff -u -r1.1 -r1.2
--- ResetPandoraProcessor.h 9 Mar 2010 20:13:42 -0000 1.1
+++ ResetPandoraProcessor.h 8 Jun 2010 22:12:42 -0000 1.2
@@ -1,4 +1,4 @@
-// $Id: ResetPandoraProcessor.h,v 1.1 2010/03/09 20:13:42 jeremy Exp $
+// $Id: ResetPandoraProcessor.h,v 1.2 2010/06/08 22:12:42 jeremy Exp $
#ifndef RESETPANDORAPROCESSOR_H
#define RESETPANDORAPROCESSOR_H 1
@@ -9,6 +9,9 @@
// pandora
#include "Api/PandoraApiImpl.h"
+/**
+ * This processor resets Pandora for the next event.
+ */
class ResetPandoraProcessor : public EventProcessor
{
public:
slicPandora/include
diff -u -r1.2 -r1.3
--- SimpleTrackProcessor.h 26 Mar 2010 18:47:33 -0000 1.2
+++ SimpleTrackProcessor.h 8 Jun 2010 22:12:42 -0000 1.3
@@ -1,4 +1,4 @@
-// $Id: SimpleTrackProcessor.h,v 1.2 2010/03/26 18:47:33 jeremy Exp $
+// $Id: SimpleTrackProcessor.h,v 1.3 2010/06/08 22:12:42 jeremy Exp $
#ifndef SIMPLETRACKPROCESSOR_H
#define SIMPLETRACKPROCESSOR_H 1
@@ -13,6 +13,12 @@
using EVENT::LCEvent;
+/**
+ * This class converts from LCIO Tracks to PandoraApi::Track::Parameters
+ * by reading in the "Tracks" collection from LCSim output events, as well
+ * as three LCGenericObject collections containing TrackStates (x,y,z,px,py,pz)
+ * at the track start, at the ECal face, and at the track end point.
+ */
class SimpleTrackProcessor : public EventProcessor
{
slicPandora/include
diff -N CalorimeterHitMaker.h
--- CalorimeterHitMaker.h 9 Mar 2010 20:13:42 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-// $Id: CalorimeterHitMaker.h,v 1.2 2010/03/09 20:13:42 jeremy Exp $
-/*
- * File: CalorimeterHitMaker.h
- * Author: ngraf
- *
- * Created on December 2, 2009, 5:45 AM
- */
-
-#ifndef _CALORIMETERHITMAKER_H
-#define _CALORIMETERHITMAKER_H
-
-#include "lcio.h"
-
-class CalorimeterHitMaker
-{
-public:
- CalorimeterHitMaker();
- CalorimeterHitMaker(const CalorimeterHitMaker& orig);
- virtual ~CalorimeterHitMaker();
- void processEvent(lcio::LCEvent* event);
-private:
-
-};
-
-#endif /* _CALORIMETERHITMAKER_H */
-
CVSspam 0.2.8