2 added + 1 removed + 9 modified, total 12 files
slicPandora/include
diff -N LcioInputCollectionSettings.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ LcioInputCollectionSettings.h 16 Sep 2011 23:31:17 -0000 1.1
@@ -0,0 +1,87 @@
+#ifndef LCIOInputCollectionSettings_h
+#define LCIOInputCollectionSettings_h 1
+
+#include <string>
+#include <map>
+
+#include "Xml/tinyxml.h"
+#include "Api/PandoraApi.h"
+#include "Pandora/StatusCodes.h"
+
+class LcioInputCollectionSettings
+{
+ public:
+
+ /**
+ * This represents the various kinds of calorimeters within Pandora.
+ */
+ enum CaloType { UNKNOWN, EM_BARREL, EM_ENDCAP, HAD_BARREL, HAD_ENDCAP, MUON_BARREL, MUON_ENDCAP };
+
+ /**
+ * Map of CaloType to list of collections.
+ */
+ typedef std::map<CaloType, std::vector<std::string> > CaloCollectionMap;
+
+ LcioInputCollectionSettings();
+ ~LcioInputCollectionSettings();
+
+ /**
+ * Read LCIO collection settings from an XML file.
+ */
+ pandora::StatusCode readSettings(const std::string& xmlFileName);
+
+ /**
+ * Add a link from CaloType to a collection.
+ */
+ void addCaloCollection(CaloType type, const std::string& collection)
+ {
+ caloCollectionMap[type].push_back(std::string(collection));
+ }
+
+ /**
+ * Get the map of CaloTypes to collections.
+ */
+ const CaloCollectionMap& getCaloCollectionMap() const;
+
+ /**
+ * Get the name of the Track collection.
+ */
+ const std::string& getTrackCollectionName();
+
+ /**
+ * Was setup from XML?
+ */
+ inline bool initialized() const
+ {
+ return m_initialized;
+ }
+
+ /**
+ * Get the CaloType from a string.
+ */
+ static const CaloType getTypeFromString(const std::string& caloTypeName);
+
+ /**
+ * Get the type string from a CaloType.
+ */
+ static const std::string& getStringFromType(CaloType caloType);
+
+ const std::vector<std::string>& getDefaultCalorimeterTypes() const;
+
+ private:
+
+ CaloCollectionMap caloCollectionMap;
+ std::string trackCollectionName;
+ bool m_initialized;
+
+ static std::string emBarrel;
+ static std::string emEndcap;
+ static std::string hadBarrel;
+ static std::string hadEndcap;
+ static std::string muonBarrel;
+ static std::string muonEndcap;
+ static std::string unknown;
+ std::vector<std::string> defaultCaloTypes;
+};
+
+#endif
slicPandora/include
diff -u -r1.5 -r1.6
--- CalorimeterHitProcessor.h 26 Nov 2010 14:52:26 -0000 1.5
+++ CalorimeterHitProcessor.h 16 Sep 2011 23:31:17 -0000 1.6
@@ -69,37 +69,35 @@
/**
* Compute the path lengths in units of interaction/radiation lengths
*/
- void GetPathLengths(const EVENT::CalorimeterHit *const pCaloHit, float &nRadiationLengthsFromIp,
- float &nInteractionLengthsFromIp);
+ //void GetPathLengths(const EVENT::CalorimeterHit *const pCaloHit, float &nRadiationLengthsFromIp,
+ // float &nInteractionLengthsFromIp);
/**
* Compute the average interaction/radiation lengths for a subdetector
*/
- void ComputeAverageLengthsFromExtraSubDetectorParameters(DetectorGeometry::ExtraSubDetectorParameters* xsubdet, float& avgIntLength, float& avgRadLength);
+ //void ComputeAverageLengthsFromExtraSubDetectorParameters(DetectorGeometry::ExtraSubDetectorParameters* xsubdet, float& avgIntLength, float& avgRadLength);
/**
* Compute the path lengths from the IP through a rectangle
*/
- float ComputePathLengthFromIPInRectangle(const pandora::CartesianVector &position, float rMin, float zMin,
- float rMax, float zMax);
+ //float ComputePathLengthFromIPInRectangle(const pandora::CartesianVector &position, float rMin, float zMin,
+ // float rMax, float zMax);
/**
* Calculate the intersection of two lines
*/
- bool IntersectLines2D(float lineAXStart, float lineAYStart, float lineAXEnd, float lineAYEnd,
- float lineBXStart, float lineBYStart, float lineBXEnd, float lineBYEnd, float &xIntersect, float &yIntersect);
+ //bool IntersectLines2D(float lineAXStart, float lineAYStart, float lineAXEnd, float lineAYEnd,
+ // float lineBXStart, float lineBYStart, float lineBXEnd, float lineBYEnd, float &xIntersect, float &yIntersect);
/**
* Calculate the corrected "radius" in a polygon
*/
- void ComputePolygonCorrection(int symmetryOrder, float distanceToIp, bool isClosestDistance, float phi0, float phi, float& correctedDistance);
-
+ //void ComputePolygonCorrection(int symmetryOrder, float distanceToIp, bool isClosestDistance, float phi0, float phi, float& correctedDistance);
private:
float m_totalEHits;
-
};
#endif
slicPandora/include
diff -u -r1.5 -r1.6
--- JobConfig.h 8 Jun 2010 22:12:41 -0000 1.5
+++ JobConfig.h 16 Sep 2011 23:31:17 -0000 1.6
@@ -1,4 +1,4 @@
-// $Id: JobConfig.h,v 1.5 2010/06/08 22:12:41 jeremy Exp $
+// $Id: JobConfig.h,v 1.6 2011/09/16 23:31:17 jeremy Exp $
#ifndef JOBCONFIG_H
#define JOBCONFIG_H 1
@@ -6,6 +6,9 @@
#include <string>
#include <vector>
+// slicPandora
+#include "LcioInputCollectionSettings.h"
+
/**
* JobConfig contains the parameters for running Pandora jobs using the JobManager.
*/
@@ -21,7 +24,9 @@
typedef std::vector<std::string> CalorimeterTypes;
JobConfig()
- : m_nevents(-1), m_nskip(0)
+ : nrun(-1),
+ nskip(0),
+ m_useDefaultCaloTypes(true)
{;}
virtual ~JobConfig()
@@ -30,41 +35,41 @@
/**
* Set the Pandora settings XML file path.
*/
- inline void setPandoraSettingsXmlFle(const char* pandoraSettingsXmlFile)
+ void setPandoraSettingsXmlFle(const char* pandoraSettingsXmlFile)
{
- m_pandoraSettingsXmlFile = std::string(pandoraSettingsXmlFile);
+ this->pandoraSettingsXmlFile = std::string(pandoraSettingsXmlFile);
}
/**
* Set the Pandora settings XML file path.
*/
- inline void setPandoraSettingsXmlFile(std::string pandoraSettingsXmlFile)
+ void setPandoraSettingsXmlFile(std::string pandoraSettingsXmlFile)
{
- m_pandoraSettingsXmlFile = pandoraSettingsXmlFile;
+ this->pandoraSettingsXmlFile = pandoraSettingsXmlFile;
}
/**
* Get the Pandora settings XML file path.
*/
- inline const std::string& getPandoraSettingsXmlFile() const
+ const std::string& getPandoraSettingsXmlFile() const
{
- return m_pandoraSettingsXmlFile;
+ return pandoraSettingsXmlFile;
}
/**
* Set the path to the input Pandora geometry file generated by GeomConverter.
*/
- inline void setGeometryFile(const char* geometryFile)
+ void setGeometryFile(const char* geometryFile)
{
- m_geometryFile = std::string(geometryFile);
+ this->geometryFile = std::string(geometryFile);
}
/**
* Set the path to the input Pandora geometry file generated by GeomConverter.
*/
- inline void setGeometryFile(std::string geometryFile)
+ void setGeometryFile(std::string geometryFile)
{
- m_geometryFile = geometryFile;
+ this-> geometryFile = geometryFile;
}
/**
@@ -72,132 +77,150 @@
*/
const std::string& getGeometryFile() const
{
- return m_geometryFile;
+ return geometryFile;
}
/**
* Add an input LCIO file.
*/
- inline void addInputFile(const char* filename)
+ void addInputFile(const char* filename)
{
- m_inputLcioFiles.push_back(std::string(filename));
+ inputLcioFiles.push_back(std::string(filename));
}
/**
* Add an input LCIO file.
*/
- inline void addInputFile(std::string filename)
+ void addInputFile(std::string filename)
{
- m_inputLcioFiles.push_back(filename);
+ inputLcioFiles.push_back(filename);
}
/**
* Get the list of input files.
*/
- const FileList getInputFiles() const
+ const FileList& getInputFiles() const
{
- return m_inputLcioFiles;
+ return inputLcioFiles;
}
/**
* Set the LCIO output file path.
*/
- inline void setOutputFile(const char* outputFile)
+ void setOutputFile(const char* outputFile)
{
- m_outputFile = std::string(outputFile);
+ this->outputFile = std::string(outputFile);
}
/**
* Set the LCIO output file path.
*/
- inline void setOutputFile(std::string outputFile)
+ void setOutputFile(std::string outputFile)
{
- m_outputFile = outputFile;
+ this->outputFile = outputFile;
}
/**
* Get the LCIO output file path.
*/
- inline const std::string& getOutputFile() const
+ const std::string& getOutputFile() const
{
- return m_outputFile;
+ return outputFile;
}
/**
* Set the maximum number of events to process.
*/
- inline void setNumberOfEvents(int nevents)
+ void setNumberOfEvents(int nrun)
{
- m_nevents = nevents;
+ this->nrun = nrun;
}
/**
* Get the maximum number of events to process.
*/
- inline const int getNumberOfEvents() const
+ const int getNumberOfEvents() const
{
- return m_nevents;
+ return nrun;
}
/**
* Set the number of events to skip.
*/
- inline void setSkipEvents(int nskip)
+ void setSkipEvents(int nskip)
{
- m_nskip = nskip;
+ this->nskip = nskip;
}
/**
* Get the number of events to skip.
*/
- inline int getSkipEvents() const
+ const int getSkipEvents() const
{
- return m_nskip;
+ return nskip;
}
/**
* Get a list of calorimeter types.
*/
- const CalorimeterTypes getCalorimeterTypes() const
+ const CalorimeterTypes& getCalorimeterTypes() const
{
- return m_calTypes;
+ return calTypes;
}
/**
* Add a CalorimeterType.
*/
- inline void addCalorimeterType(const char* calType)
+ void addCalorimeterType(const char* calType)
{
- m_calTypes.push_back(std::string(calType));
+ calTypes.push_back(std::string(calType));
}
/**
* Add a CalorimeterType.
*/
- inline void addCalorimeterType(std::string calType)
+ void addCalorimeterType(std::string calType)
{
- m_calTypes.push_back(calType);
+ calTypes.push_back(calType);
}
/**
* Setup to use the default CalorimeterTypes list.
*/
- void useDefaultCalorimeterTypes();
+ void setupDefaultCalorimeterTypes();
+
+ /**
+ * Set the XML file used for LCIO collection config.
+ */
+ void setLcioConfigFile(const char* lcioConfigFile)
+ {
+ this->lcioConfigFile = lcioConfigFile;
+ m_useDefaultCaloTypes = false;
+ }
/**
- * Get the default CalorimeterTypes list.
+ * Get the XML file used for LCIO collection config.
*/
- inline CalorimeterTypes getDefaultCalorimeterTypes();
-
+ const std::string& getLcioConfigFile() const
+ {
+ return lcioConfigFile;
+ }
+
+ const bool useDefaultCaloTypes() const
+ {
+ return m_useDefaultCaloTypes;
+ }
+
private:
- std::string m_pandoraSettingsXmlFile;
- std::string m_geometryFile;
- std::string m_outputFile;
- CalorimeterTypes m_calTypes;
- FileList m_inputLcioFiles;
- int m_nevents;
- int m_nskip;
- bool m_useDefaultCalTypes;
+ std::string pandoraSettingsXmlFile;
+ std::string geometryFile;
+ std::string outputFile;
+ std::string lcioConfigFile;
+ CalorimeterTypes calTypes;
+ FileList inputLcioFiles;
+ int nrun;
+ int nskip;
+ bool m_useDefaultCaloTypes;
};
#endif
slicPandora/include
diff -u -r1.9 -r1.10
--- JobManager.h 24 Nov 2010 16:44:08 -0000 1.9
+++ JobManager.h 16 Sep 2011 23:31:17 -0000 1.10
@@ -1,4 +1,4 @@
-// $Id: JobManager.h,v 1.9 2010/11/24 16:44:08 speckmay Exp $
+// $Id: JobManager.h,v 1.10 2011/09/16 23:31:17 jeremy Exp $
#ifndef JobManager_h
#define JobManager_h 1
@@ -10,6 +10,7 @@
// slicPandora
#include "JobConfig.h"
+#include "LcioInputCollectionSettings.h"
class DetectorGeometry;
class EventProcessor;
@@ -73,6 +74,16 @@
*/
const pandora::Pandora& getPandora();
+ /**
+ * Get the LCIO input collection settings for the job.
+ */
+ inline const LcioInputCollectionSettings& getLcioCollectionSettings() const
+ {
+ return collectionSettings;
+ }
+
+ pandora::StatusCode setupDefaultLcioInputCollectionSettings(LcioInputCollectionSettings& lcioConfig);
+
private:
/**
@@ -102,6 +113,7 @@
EventProcessors m_processors;
bool m_geometryLoaded;
bool m_initialized;
+ LcioInputCollectionSettings collectionSettings;
};
#endif
slicPandora/include
diff -u -r1.2 -r1.3
--- SimCalorimeterHitProcessor.h 3 Mar 2010 22:47:52 -0000 1.2
+++ SimCalorimeterHitProcessor.h 16 Sep 2011 23:31:17 -0000 1.3
@@ -20,7 +20,10 @@
virtual ~SimCalorimeterHitProcessor();
public:
- void processEvent(EVENT::LCEvent*);
+ void processEvent(EVENT::LCEvent*);
+
+ // New impl.
+ void processEventNew(EVENT::LCEvent*);
};
#endif
slicPandora/src
diff -N LcioInputCollectionSettings.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ LcioInputCollectionSettings.cpp 16 Sep 2011 23:31:18 -0000 1.1
@@ -0,0 +1,181 @@
+// $Id: LcioInputCollectionSettings.cpp,v 1.1 2011/09/16 23:31:18 jeremy Exp $
+#include "LcioInputCollectionSettings.h"
+
+
+std::string LcioInputCollectionSettings::emBarrel = "EM_BARREL";
+std::string LcioInputCollectionSettings::emEndcap = "EM_ENDCAP";
+std::string LcioInputCollectionSettings::hadBarrel = "HAD_BARREL";
+std::string LcioInputCollectionSettings::hadEndcap = "HAD_ENDCAP";
+std::string LcioInputCollectionSettings::muonBarrel = "MUON_BARREL";
+std::string LcioInputCollectionSettings::muonEndcap = "MUON_ENDCAP";
+std::string LcioInputCollectionSettings::unknown = "UNKNOWN";
+
+LcioInputCollectionSettings::LcioInputCollectionSettings()
+ : m_initialized(false)
+{
+ // Init default CaloType list.
+ defaultCaloTypes.push_back(emBarrel);
+ defaultCaloTypes.push_back(emEndcap);
+ defaultCaloTypes.push_back(hadBarrel);
+ defaultCaloTypes.push_back(hadEndcap);
+ defaultCaloTypes.push_back(muonBarrel);
+ defaultCaloTypes.push_back(muonEndcap);
+}
+
+LcioInputCollectionSettings::~LcioInputCollectionSettings()
+{;}
+
+pandora::StatusCode LcioInputCollectionSettings::readSettings(const std::string& xmlFileName)
+{
+ if (m_initialized)
+ {
+ std::cout << "Already initialized." << std::endl;
+ return pandora::STATUS_CODE_FAILURE;
+ }
+
+ try
+ {
+ TiXmlDocument xmlDoc(xmlFileName);
+
+ if (!xmlDoc.LoadFile())
+ {
+ std::cout << "LCIOInputCollectionSettings::readSettings - Invalid XML file." << std::endl;
+ throw pandora::StatusCodeException(pandora::STATUS_CODE_FAILURE);
+ }
+
+ const TiXmlHandle pXmlDocHandle(&xmlDoc);
+ const TiXmlHandle pXmlHandle = TiXmlHandle(pXmlDocHandle.FirstChildElement().Element());
+
+ // Loop over CaloCollection elements.
+ for (TiXmlElement* pXmlElement = pXmlHandle.FirstChild("CaloCollection").Element(); NULL != pXmlElement;
+ pXmlElement = pXmlElement->NextSiblingElement("CaloCollection"))
+ {
+ //std::cout << "name: " << pXmlElement->Attribute("name") << std::endl;
+ //std::cout << "type: " << pXmlElement->Attribute("caloType") << std::endl;
+ //std::cout << "typeFromStr: " << getTypeFromString(pXmlElement->Attribute("caloType")) << std::endl;
+ //std::cout << std::endl;
+
+ CaloType calType = getTypeFromString(pXmlElement->Attribute("caloType"));
+ std::string collName = pXmlElement->Attribute("name");
+ if (calType != UNKNOWN)
+ {
+ caloCollectionMap[calType].push_back(std::string(collName));
+ }
+ else
+ {
+ std::cout << "Unknown caloType argument." << std::endl;
+ return pandora::STATUS_CODE_FAILURE;
+ }
+ }
+
+ // Track collection.
+ TiXmlElement* pTrackCollElement = pXmlHandle.FirstChild("TrackCollection").Element();
+ if (pTrackCollElement != NULL)
+ {
+ if (pTrackCollElement->Attribute("name") != NULL)
+ {
+ trackCollectionName = pTrackCollElement->Attribute("name");
+ }
+ else
+ {
+ std::cout << "TrackCollection is missing name attribute." << std::endl;
+ return pandora::STATUS_CODE_FAILURE;
+ }
+ }
+ }
+ catch (pandora::StatusCodeException &statusCodeException)
+ {
+ std::cout << "Failure in reading collection settings." << statusCodeException.ToString() << std::endl;
+ }
+ catch (...)
+ {
+ std::cout << "Unrecognized exception while Pandora settings file." << std::endl;
+ }
+
+ m_initialized = true;
+
+ return pandora::STATUS_CODE_SUCCESS;
+
+}
+
+const LcioInputCollectionSettings::CaloType LcioInputCollectionSettings::getTypeFromString(const std::string& caloTypeName)
+{
+ if (caloTypeName.compare("EM_BARREL") == 0)
+ {
+ return EM_BARREL;
+ }
+ else if (caloTypeName.compare("EM_ENDCAP") == 0)
+ {
+ return EM_ENDCAP;
+ }
+ else if (caloTypeName.compare("HAD_BARREL") == 0)
+ {
+ return HAD_BARREL;
+ }
+ else if (caloTypeName.compare("HAD_ENDCAP") == 0)
+ {
+ return HAD_ENDCAP;
+ }
+ else if (caloTypeName.compare("MUON_BARREL") == 0)
+ {
+ return MUON_BARREL;
+ }
+ else if (caloTypeName.compare("MUON_ENDCAP") == 0)
+ {
+ return MUON_ENDCAP;
+ }
+ else
+ {
+ return UNKNOWN;
+ }
+}
+
+const std::string& LcioInputCollectionSettings::getStringFromType(CaloType caloType)
+{
+ static std::string ecalBarrel("EM_BARREL");
+ static std::string ecalEndcap("EM_ENDCAP");
+ static std::string hcalBarrel("HAD_BARREL");
+ static std::string hcalEndcap("HAD_ENDCAP");
+ static std::string muonBarrel("MUON_BARREL");
+ static std::string muonEndcap("MUON_ENDCAP");
+ static std::string unknown("UNKNOWN");
+
+ if (caloType == EM_BARREL)
+ {
+ return ecalBarrel;
+ }
+ else if (caloType == EM_ENDCAP)
+ {
+ return ecalEndcap;
+ }
+ else if (caloType == HAD_BARREL)
+ {
+ return hcalBarrel;
+ }
+ else if (caloType == HAD_ENDCAP)
+ {
+ return hcalEndcap;
+ }
+ else if (caloType == MUON_BARREL)
+ {
+ return muonBarrel;
+ }
+ else if (caloType == MUON_ENDCAP)
+ {
+ return muonEndcap;
+ }
+ else
+ {
+ return unknown;
+ }
+}
+
+const LcioInputCollectionSettings::CaloCollectionMap& LcioInputCollectionSettings::getCaloCollectionMap() const
+{
+ return caloCollectionMap;
+}
+
+const std::vector<std::string>& LcioInputCollectionSettings::getDefaultCalorimeterTypes() const
+{
+ return this->defaultCaloTypes;
+}
slicPandora/src
diff -u -r1.20 -r1.21
--- CalorimeterHitProcessor.cpp 7 Sep 2011 22:39:02 -0000 1.20
+++ CalorimeterHitProcessor.cpp 16 Sep 2011 23:31:18 -0000 1.21
@@ -1,10 +1,4 @@
-// $Id: CalorimeterHitProcessor.cpp,v 1.20 2011/09/07 22:39:02 jeremy Exp $
-
-// variable names change from cdr to trunk version. use the new names, and keep the transformation of the names in defines
-//#define m_nCellRadiationLengths m_nRadiationLengths
-//#define m_nCellInteractionLengths m_nInteractionLengths
-//#define m_cellNormalVector m_normalVector
-
+// $Id: CalorimeterHitProcessor.cpp,v 1.21 2011/09/16 23:31:18 jeremy Exp $
#include "CalorimeterHitProcessor.h"
@@ -26,58 +20,65 @@
void CalorimeterHitProcessor::processEvent(EVENT::LCEvent* event)
{
- m_totalEHits = 0.;
+ //m_totalEHits = 0.;
+ // Get the parameter objects necessary for CaloHit conversion to Pandora.
const pandora::Pandora& pandora = getJobManager()->getPandora();
DetectorGeometry* geom = getJobManager()->getDetectorGeometry();
- JobConfig::CalorimeterTypes calTypes = getJobManager()->getJobConfig()->getCalorimeterTypes();
- for (JobConfig::CalorimeterTypes::const_iterator iter = calTypes.begin();
- iter != calTypes.end();
- iter++)
+ const LcioInputCollectionSettings::CaloCollectionMap& caloCollMap = getJobManager()->getLcioCollectionSettings().getCaloCollectionMap();
+
+ for (LcioInputCollectionSettings::CaloCollectionMap::const_iterator iter = caloCollMap.begin();
+ iter != caloCollMap.end();
+ iter++)
{
- std::string calType = *iter;
+ std::string caloType = LcioInputCollectionSettings::getStringFromType(iter->first);
+
+ //std::cout << "CaloHitProc - " << caloType << std::endl;
// Get the SubDetector parameters.
- PandoraApi::GeometryParameters::SubDetectorParameters* subdet = geom->getSubDetectorFromType(calType);
- DetectorGeometry::ExtraSubDetectorParameters* xsubdet = geom->getExtraSubDetectorParametersFromType(calType);
+ PandoraApi::GeometryParameters::SubDetectorParameters* subdet = geom->getSubDetectorFromType(caloType);
+ DetectorGeometry::ExtraSubDetectorParameters* xsubdet = geom->getExtraSubDetectorParametersFromType(caloType);
const LCCollection* caloHits;
// Check again if collection exists. If not, could be okay so skip and move on.
try
{
- caloHits = event->getCollection(*iter);
+ caloHits = event->getCollection(caloType);
}
catch (...)
{
- continue;
+ std::cout << "Could not get collection " << caloType << " from event." << std::endl;
+ throw new std::exception;
}
int nhits = caloHits->getNumberOfElements();
-#ifdef CALO_PARAMS_DEBUG
- std::cout << "COLLECTION: " << calType << std::endl;
-#endif
+ //std::cout << "Collection " << caloType << " has " << nhits << " hits." << std::endl;
+
+//#ifdef CALO_PARAMS_DEBUG
+// std::cout << "COLLECTION: " << caloType << std::endl;
+//#endif
for (int i=0; i<nhits; i++)
{
CalorimeterHit* calHit = dynamic_cast<CalorimeterHit*> (caloHits->getElementAt(i));
PandoraApi::CaloHit::Parameters caloHitParams = makeCaloHitParameters(subdet, xsubdet, calHit);
-#ifdef CALO_PARAMS_DEBUG
- printCaloHitParameters(caloHitParams);
-#endif
+//#ifdef CALO_PARAMS_DEBUG
+// printCaloHitParameters(caloHitParams);
+//#endif
PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::CaloHit::Create(pandora, caloHitParams));
}
-#ifdef CALO_PARAMS_DEBUG
- std::cout << "-----------------------------------------------------" << std::endl;
-#endif
+//#ifdef CALO_PARAMS_DEBUG
+// std::cout << "-----------------------------------------------------" << std::endl;
+//#endif
}
-#ifdef CALO_PARAMS_DEBUG
- std::cout << "totalEHits: " << m_totalEHits << std::endl;
-#endif
- m_totalEHits = 0;
+//#ifdef CALO_PARAMS_DEBUG
+// std::cout << "totalEHits: " << m_totalEHits << std::endl;
+//#endif
+// m_totalEHits = 0;
}
PandoraApi::CaloHit::Parameters CalorimeterHitProcessor::makeCaloHitParameters(
@@ -185,7 +186,7 @@
}
// DEBUG
- m_totalEHits += params.m_inputEnergy.Get();
+ //m_totalEHits += params.m_inputEnergy.Get();
// END DEBUG
// Layer number.
@@ -229,18 +230,15 @@
params.m_cellNormalVector = pandora::CartesianVector(0., 0., pos[2]/fabs(pos[2]));
}
+ // Return completed calorimeter parameters.
+ return params;
+
// Number of interaction lengths from the IP.
//float intLengthsFromIp = 0.f;
//float radLengthsFromIp = 0.f;
//GetPathLengths(hit, radLengthsFromIp, intLengthsFromIp);
//params.m_nInteractionLengthsFromIp = intLengthsFromIp;
-
-
//params.m_nRadiationLengthsFromIp = radLengthsFromIp;
-
-
- // Return completed calorimeter parameters.
- return params;
}
@@ -261,7 +259,7 @@
}
-
+/*
void CalorimeterHitProcessor::GetPathLengths(const EVENT::CalorimeterHit *const pCaloHit, float &nRadiationLengthsFromIp,
float &nInteractionLengthsFromIp)
{
@@ -729,4 +727,4 @@
// std::cout << "distance " << distanceToIp << " corrected distance " << correctedDistance << std::endl;
}
}
-
+*/
slicPandora/src
diff -u -r1.25 -r1.26
--- DetectorGeometry.cpp 16 Feb 2011 09:28:32 -0000 1.25
+++ DetectorGeometry.cpp 16 Sep 2011 23:31:18 -0000 1.26
@@ -2,6 +2,7 @@
// pandora
#include "Pandora/PandoraInputTypes.h"
+#include "Helpers/XmlHelper.h"
// slicPandora
#include "IDDecoder.h"
@@ -14,7 +15,7 @@
#include <cmath>
// tinyxml
-#include "tinyxml.h"
+//#include "tinyxml.h"
using namespace std;
@@ -284,6 +285,7 @@
}
// Assume ECal barrel is innermost detector.
+ // FIXME Pandora variables changed names?
//geom.m_inDetBarrelParameters = geom.m_eCalBarrelParameters;
//geom.m_inDetEndCapParameters = geom.m_eCalEndCapParameters;
slicPandora/src
diff -u -r1.13 -r1.14
--- JobManager.cpp 17 Feb 2011 12:45:17 -0000 1.13
+++ JobManager.cpp 16 Sep 2011 23:31:18 -0000 1.14
@@ -6,13 +6,11 @@
#include "EventProcessor.h"
#include "SimpleBFieldCalculator.h"
-
// pandora
#include "PfoConstructionAlgorithm.h"
#include "FineGranularityPseudoLayerCalculator.h"
#include "FineGranularityContent.h"
-
// lcio
#include "IOIMPL/LCFactory.h"
#include "EVENT/LCIO.h"
@@ -42,13 +40,48 @@
JobManager::~JobManager()
{}
+pandora::StatusCode JobManager::setupDefaultLcioInputCollectionSettings(LcioInputCollectionSettings& lcioConfig)
+{
+ const std::vector<std::string>& caloTypes = lcioConfig.getDefaultCalorimeterTypes();
+
+ for (std::vector<std::string>::const_iterator it = caloTypes.begin(); it != caloTypes.end(); it++)
+ {
+ // Get the CaloType string.
+ const std::string& caloType = (*it);
+
+ // Get the collection name from the CaloType.
+ const std::string& caloColl = this->getDetectorGeometry()->getExtraSubDetectorParametersFromType(caloType)->m_collection;
+
+ // Add link from CaloType to collection.
+ lcioConfig.addCaloCollection(LcioInputCollectionSettings::getTypeFromString(caloType), caloColl);
+
+ // DEBUG
+ std::cout << "added default mapping of CaloType " << caloType << " to collection " << caloColl << std::endl;
+ }
+
+ return pandora::STATUS_CODE_SUCCESS;
+}
+
void JobManager::initialize()
{
// Create new Pandora instance.
m_pandora = new pandora::Pandora();
// Create the slicPandora DetectorGeometry.
- PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, createGeometry());
+ PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, createGeometry());
+
+ // Read in the LCIO input collection settings which may override the defaults from the detector.
+ if (!m_config->useDefaultCaloTypes())
+ {
+ //std::cout << "using custom LCIO input config" << std::endl; // DEBUG
+ PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, collectionSettings.readSettings(m_config->getLcioConfigFile()));
+ }
+ // Use default settings of readout collections from the geometry XML file.
+ else
+ {
+ //std::cout << "default CalTypes" << std::endl; // DEBUG
+ PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, setupDefaultLcioInputCollectionSettings(collectionSettings));
+ }
// create a new bfield calculator
PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::SetBFieldCalculator(*m_pandora, new SimpleBFieldCalculator()));
@@ -67,10 +100,10 @@
PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Geometry::Create(*m_pandora, *m_detectorGeometry->getGeometryParameters()));
// Register the the user algorithm factories with Pandora.
- PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, registerUserAlgorithmFactories());
+ PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, registerUserAlgorithmFactories());
// Read the run control settings into Pandora.
- PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::ReadSettings(*m_pandora, m_config->getPandoraSettingsXmlFile()));
+ PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::ReadSettings(*m_pandora, m_config->getPandoraSettingsXmlFile()));
}
void JobManager::setJobConfig(JobConfig* config)
slicPandora/src
diff -u -r1.26 -r1.27
--- SimCalorimeterHitProcessor.cpp 15 Apr 2011 14:23:57 -0000 1.26
+++ SimCalorimeterHitProcessor.cpp 16 Sep 2011 23:31:18 -0000 1.27
@@ -8,6 +8,7 @@
#include "JobConfig.h"
#include "DetectorGeometry.h"
#include "IDDecoder.h"
+#include "LcioInputCollectionSettings.h"
// lcio
#include "EVENT/LCIO.h"
@@ -36,6 +37,13 @@
void SimCalorimeterHitProcessor::processEvent(EVENT::LCEvent* event)
{
+ processEventNew(event);
+}
+
+// Old code.
+/*
+void SimCalorimeterHitProcessor::processEvent(EVENT::LCEvent* event)
+{
//std::cout << "SimCalorimeterHitProcessor::processEvent" << std::endl;
JobManager* mgr = getJobManager();
@@ -55,12 +63,9 @@
scRel->parameters().setValue("RelationFromType", EVENT::LCIO::CALORIMETERHIT);
scRel->parameters().setValue("RelationToType", EVENT::LCIO::SIMCALORIMETERHIT);
-
typedef std::map<MCParticle *, float> MCParticleToEnergyWeightMap;
MCParticleToEnergyWeightMap mcParticleToEnergyWeightMap;
-
-
// Loop over calorimeter types.
for (JobConfig::CalorimeterTypes::iterator iter = calTypes.begin();
iter != calTypes.end();
@@ -216,3 +221,204 @@
// Add the CalorimeterHit to SimCalorimeterHit relations.
event->addCollection(scRel, "CalorimeterHitRelations");
}
+*/
+
+void SimCalorimeterHitProcessor::processEventNew(EVENT::LCEvent* event)
+{
+ // Get pointers to parameter and manager classes.
+ JobManager* mgr = getJobManager();
+ const pandora::Pandora& pandora = mgr->getPandora();
+ DetectorGeometry* geom = mgr->getDetectorGeometry();
+ const LcioInputCollectionSettings& lcioConfig = mgr->getLcioCollectionSettings();
+ const LcioInputCollectionSettings::CaloCollectionMap& caloCollMap = lcioConfig.getCaloCollectionMap();
+
+ // Make the relation table from SimCalorimeterHit to corresponding CalorimeterHit.
+ LCCollectionVec* scRel = new LCCollectionVec(EVENT::LCIO::LCRELATION);
+ scRel->parameters().setValue("RelationFromType", EVENT::LCIO::CALORIMETERHIT);
+ scRel->parameters().setValue("RelationToType", EVENT::LCIO::SIMCALORIMETERHIT);
+
+ typedef std::map<MCParticle *, float> MCParticleToEnergyWeightMap;
+ MCParticleToEnergyWeightMap mcParticleToEnergyWeightMap;
+
+ // Set correct flags for output collection.
+ int flag = 1 << EVENT::LCIO::RCHBIT_LONG; // position
+ flag |= 1 << EVENT::LCIO::RCHBIT_ID1; // cellId1
+ flag |= 1 << EVENT::LCIO::RCHBIT_TIME; // time
+ LCFlagImpl chFlag(flag);
+
+ // Loop over CaloTypes.
+ for (LcioInputCollectionSettings::CaloCollectionMap::const_iterator it = caloCollMap.begin(); it != caloCollMap.end(); it++)
+ {
+ // Get the CaloType string.
+ const std::string& caloType = LcioInputCollectionSettings::getStringFromType(it->first);
+
+ // DEBUG
+ //std::cout << "SimCalHitProc - " << caloType << std::endl;
+
+ // Skip over unknown types of cal collections.
+ if (caloType.compare("UNKNOWN") == 0)
+ {
+ std::cout << "Skipping unknown type of calorimeter collections!" << std::endl;
+ continue;
+ }
+
+ // Get the pandora subdet params from this cal type.
+ PandoraApi::GeometryParameters::SubDetectorParameters* subdet = geom->getSubDetectorFromType(caloType);
+ if (subdet == NULL)
+ {
+ std::cout << "The SubdetectorParameters for " << caloType << " were not found." << std::endl;
+ throw new std::exception;
+ }
+
+ // Get the extra subdet params from this cal type.
+ DetectorGeometry::ExtraSubDetectorParameters* xsubdet = geom->getExtraSubDetectorParametersFromType(caloType);
+ if (xsubdet == NULL)
+ {
+ std::cout << "The ExtraSubDetectorParameters for " << caloType << " were not found." << std::endl;
+ throw new std::exception;
+ }
+
+ // Get the decoder.
+ IDDecoder* decoder = xsubdet->m_decoder;
+
+ // Get cuts from xsubdet.
+ float mipCut = xsubdet->m_mipCut.Get();
+ float timeCut = xsubdet->m_timeCut.Get();
+
+ // Get layer parameters for subdet.
+ PandoraApi::GeometryParameters::LayerParametersList* layerList = &(subdet->m_layerParametersList);
+
+ // Create a new LCIO CalHit collection.
+ LCCollection* calHits = new LCCollectionVec(EVENT::LCIO::CALORIMETERHIT);
+ calHits->setFlag(chFlag.getFlag());
+
+ // Loop over input collection names. All input collections will be merged into collection by type,
+ // so all the subdetectors of one CaloType should be from the same subdetector.
+ const std::vector<std::string>& collections = it->second;
+ for (std::vector<std::string> ::const_iterator it2 = collections.begin(); it2 != collections.end(); it2++)
+ {
+ // Get the collection name.
+ const std::string& collectionName = (*it2);
+
+ // DEBUG
+ //std::cout << "collectionName - " << collectionName << std::endl;
+
+ // Lookup CalHit collection in input event.
+ LCCollection* simCalHits = 0;
+ try
+ {
+ simCalHits = event->getCollection(collectionName);
+ }
+ catch (EVENT::DataNotAvailableException& de)
+ {
+ std::cout << "Failed to get SimCalHit collection " << collectionName << " from event." << std::endl;
+ throw new std::exception;
+ }
+ catch (std::exception& e)
+ {
+ std::cout << "Caught unknown exception trying to access " << collectionName << " from event." << std::endl;
+ throw new std::exception;
+ }
+
+ // Convert input SimCalorimeterHits into CalorimeterHits.
+ int nSimHits = simCalHits->getNumberOfElements();
+
+ // DEBUG
+ //std::cout << "going to proc " << nSimHits << " SimCalHits from input coll" << std::endl;
+
+ // Loop over input SimCalHits.
+ for (int i = 0; i < nSimHits; i++)
+ {
+ // Get the SimCalorimeterHit to be converted.
+ SimCalorimeterHit* simCalHit = dynamic_cast<SimCalorimeterHit*> (simCalHits->getElementAt(i));
+
+ // Get first time contrib.
+ float timeCont = simCalHit->getTimeCont(0);
+
+ // Get energy.
+ float rawEnergy = simCalHit->getEnergy();
+
+ // Time cut on late times.
+ if (timeCont > timeCut)
+ {
+ continue;
+ }
+
+ // Cut on input hits with energy less than mipCut.
+ if (rawEnergy < mipCut)
+ {
+ continue;
+ }
+
+ // Create a new CalorimeterHit.
+ CalorimeterHitImpl* calHit = new CalorimeterHitImpl;
+
+ // Get the two 32-bit chunks of the id.
+ int cellId0 = simCalHit->getCellID0();
+ int cellId1 = simCalHit->getCellID1();
+
+ // Make a 64-bit id for the IDDecoder.
+ // The type MUST be "long long" and not "long". (from tonyj)
+ long long cellId = ((long long)cellId1)<<32 | cellId0;
+
+ // Decode the layer number from the id.
+ int layer = decoder->getFieldValue("layer", cellId);
+
+ // Get the layer parameters for this layer.
+ PandoraApi::GeometryParameters::LayerParameters layerParams = (*layerList)[layer];
+
+ // Get the extra layer parameters for this layer (sampling).
+ float samplingFrac = 0.f;
+ try
+ {
+ DetectorGeometry::ExtraLayerParameters xlayerParams = xsubdet->m_extraLayerParams.at(layer);
+ // Get the sampling fraction for this layer.
+ // TODO: Separate EM + HAD sampling fractions.
+ samplingFrac = xlayerParams.m_samplingFraction.Get();
+ }
+ // FIXME What exception caught here?
+ catch(...)
+ {
+ std::cout << "No layer #" << layer << " existing in detector " << caloType << std::endl;
+ throw;
+ }
+
+ // Copy SimCalorimeterHit information into CalorimeterHit.
+ calHit->setEnergy(simCalHit->getEnergy() / samplingFrac);
+ calHit->setCellID0(simCalHit->getCellID0());
+ calHit->setCellID1(simCalHit->getCellID1());
+ calHit->setTime(simCalHit->getTimeCont(0));
+ calHit->setPosition(simCalHit->getPosition());
+
+ // Setup the relation between CalHit and SimHit.
+ scRel->addElement(new LCRelationImpl(calHit, simCalHit, 0.5));
+
+ // FIXME Need to add links for CalorimeterHit collections that already exist.
+ mcParticleToEnergyWeightMap.clear();
+ for (int iCont = 0, iEnd = simCalHit->getNMCContributions(); iCont < iEnd; ++iCont)
+ {
+ mcParticleToEnergyWeightMap[simCalHit->getParticleCont(iCont)] += simCalHit->getEnergyCont(iCont);
+ }
+
+ for (MCParticleToEnergyWeightMap::const_iterator mcParticleIter = mcParticleToEnergyWeightMap.begin(),
+ mcParticleIterEnd = mcParticleToEnergyWeightMap.end(); mcParticleIter != mcParticleIterEnd; ++mcParticleIter)
+ {
+ PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::SetCaloHitToMCParticleRelationship(pandora, calHit , mcParticleIter->first, mcParticleIter->second));
+ }
+
+ // Add the created CalorimeterHit to the collection.
+ calHits->addElement(calHit);
+ }
+ }
+
+ // Set the ReadoutName parameter for LCSim to find the correct IDDecoder.
+ // FIXME Which name set here?
+ //calHits->parameters().setValue("ReadoutName", collectionName);
+
+ // Add the CalorimeterHits to the event with the collection name the same as the calorimeter type, e.g. EM_BARREL.
+ event->addCollection(calHits, caloType);
+ }
+
+ // Add the CalorimeterHit to SimCalorimeterHit relations.
+ event->addCollection(scRel, "CalorimeterHitRelations");
+}
slicPandora/src
diff -N JobConfig.cpp
--- JobConfig.cpp 24 Sep 2010 07:22:50 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-#include "JobConfig.h"
-
-JobConfig::CalorimeterTypes JobConfig::getDefaultCalorimeterTypes()
-{
- static CalorimeterTypes defaultCalTypes;
- defaultCalTypes.push_back(std::string("EM_BARREL"));
- defaultCalTypes.push_back(std::string("EM_ENDCAP"));
- defaultCalTypes.push_back(std::string("HAD_BARREL"));
- defaultCalTypes.push_back(std::string("HAD_ENDCAP"));
- defaultCalTypes.push_back(std::string("MUON_BARREL"));
- defaultCalTypes.push_back(std::string("MUON_ENDCAP"));
-// defaultCalTypes.push_back(std::string("HCAL_PLUG"));
- return defaultCalTypes;
-}
-
-void JobConfig::useDefaultCalorimeterTypes()
-{
- CalorimeterTypes defaultCalTypes = getDefaultCalorimeterTypes();
- for (CalorimeterTypes::iterator iter = defaultCalTypes.begin();
- iter != defaultCalTypes.end();
- iter++)
- {
- m_calTypes.push_back((*iter));
- }
-}
slicPandora/tests
diff -u -r1.6 -r1.7
--- PandoraFrontend.cpp 5 Nov 2010 17:57:29 -0000 1.6
+++ PandoraFrontend.cpp 16 Sep 2011 23:31:18 -0000 1.7
@@ -1,11 +1,16 @@
-//$Id: PandoraFrontend.cpp,v 1.6 2010/11/05 17:57:29 jeremy Exp $
+//$Id: PandoraFrontend.cpp,v 1.7 2011/09/16 23:31:18 jeremy Exp $
/**
- * This is a simple frontend to run slicPandora. It takes an ordered list of arguments. (See usage method.)
+ * This is a simple frontend to run slicPandora.
*/
+// FIXME: Turn the frontend into a class.
// stl
#include <iostream>
+#include <stdlib.h>
+
+// getopt
+#include <getopt.h>
// slicPandora
#include "JobManager.h"
@@ -16,65 +21,153 @@
void printUsage()
{
- cout << "./bin/PandoraFrontend geometry.xml pandoraSettings.xml inputEvents.slcio reconOutput.slcio nevents skip" << endl << endl;
- cout << " The [nevents] argument is optional. By default, PandoraFrontend will run over all of the input events." << std::endl;
- cout << " The [skip] argument is optional. By default, PandoraFrontend will start at the first event." << std::endl;
+ cout << "./bin/PandoraFrontend -g [geometry] -c [pandoraConfig] -i [inputEvents] -o [outputEvents] -l [lcioConfig] -r [nrun] -s [nskip]" << endl << endl;
+ cout << " [-r] is optional. Default is run over all input events." << endl;
+ cout << " [-s] is optional. Default is start at the first event." << endl;
+ cout << " [-l] is optional. Default is use subdetector's associated hit collections from geometry." << endl;
+ cout << " [-o] is optional. Default output file is called \"pandoraOutput.slcio\"." << endl;
}
int main(int argc, char **argv)
{
- int nargs = argc - 1;
+ // getopt flags.
+ int g;
+ opterr = 0;
+
+ // Variables for holding getopt values.
+ int nrun = -1;
+ int nskip = 0;
+ char *geometryFile = NULL;
+ char *configFile = NULL;
+ char *outputFile = "pandoraOutput.slcio";
+ char *lcioConfigFile = NULL;
+ char *inputFile = NULL;
+
+ // Process command line options.
+ while ((g = getopt(argc, argv, "g:c:i:r:s:l:o:")) != -1)
+ {
+ switch (g)
+ {
+ // Geometry file.
+ case 'g':
+ geometryFile = optarg;
+ break;
+ // Pandora config file.
+ case 'c':
+ configFile = optarg;
+ break;
+ // Output file path.
+ case 'o':
+ outputFile = optarg;
+ break;
+ // Input LCIO file.
+ case 'i':
+ inputFile = optarg;
+ break;
+ // LCIO XML collection config file.
+ case 'l':
+ lcioConfigFile = optarg;
+ break;
+ // Number of events to run.
+ case 'r':
+ nrun = atoi(optarg);
+ break;
+ // Number of events to skip.
+ case 's':
+ nskip = atoi(optarg);
+ break;
+ // There are no valid non-switch arguments.
+ default:
+ printUsage();
+ return 1;
+ }
+ }
+
+ // Print arguments.
+ cout << "slicPandora got these args ..." << endl;
+ cout << endl;
+ cout << "geometryFile (-g) = " << geometryFile << endl;
+ cout << "configFile (-c) = " << configFile << endl;
+ cout << "outputFile (-o) = " << outputFile << endl;
+ cout << "inputFile (-i) = " << inputFile << endl;
+ if (lcioConfigFile != NULL)
+ {
+ cout << "lcioCollFile (-l) = " << lcioConfigFile << endl;
+ }
+ if (nrun > 0)
+ {
+ cout << "nrun (-r) = " << nrun << endl;
+ }
+ if (nskip > 0)
+ {
+ cout << "nskip (-s) = " << nskip << endl;
+ }
+ cout << endl;
+
+ // Error flag.
+ bool error = false;
+
+ // Create the job configuration from the command line arguments.
+ JobConfig* config = new JobConfig();
- if (nargs < 4 || nargs > 6)
+ // Pandora config.
+ if (configFile != NULL)
{
- printUsage();
- exit(1);
+ config->setPandoraSettingsXmlFile(configFile);
+ }
+ else
+ {
+ cout << "Missing config file." << endl;
+ error = true;
}
- // Geometry input file.
- std::string geometry = argv[1];
+ // Geometry file.
+ if (geometryFile != NULL)
+ {
+ config->setGeometryFile(geometryFile);
+ }
+ else
+ {
+ cout << "Missing geometry file." << endl;
+ error = true;
+ }
- // Pandora settings file.
- std::string pandoraSettings = argv[2];
+ // Input file.
+ if (inputFile != NULL)
+ {
+ config->addInputFile(inputFile);
+ }
+ else
+ {
+ cout << "Missing input file." << endl;
+ error = true;
+ }
- // Input events file in .slcio format.
- std::string inputEvents = argv[3];
+ // Output file. Don't need to check for null because it has a default.
+ config->setOutputFile(outputFile);
- // Output events file.
- std::string outputEvents = argv[4];
-
- // Number of events (optional).
- int nevents = -1;
- if (nargs >= 5)
+ // Skip events.
+ if (nskip != 0)
{
- nevents = atoi(argv[5]);
+ config->setSkipEvents(nskip);
}
- // skip events (optional).
- int skipEvents = -1;
- if (nargs == 6)
+ // LCIO config file.
+ if (lcioConfigFile != NULL)
{
- skipEvents = atoi(argv[6]);
+ config->setLcioConfigFile(lcioConfigFile);
}
- // Print out arguments before starting job.
- cout << "PandoraFrontend got " << nargs << " arguments ..." << endl;
- cout << " geometry: " << geometry << endl;
- cout << " pandoraSettings: " << pandoraSettings << endl;
- cout << " inputEvents: " << inputEvents << endl;
- cout << " outputEvents: " << outputEvents << endl;
- cout << " nevents: " << nevents << endl;
- cout << " skip: " << skipEvents << endl << endl;
+ // Number of events to run.
+ config->setNumberOfEvents(nrun);
- // Create the job configuration from the command line arguments.
- JobConfig* config = new JobConfig();
- config->setPandoraSettingsXmlFile(pandoraSettings);
- config->setGeometryFile(geometry);
- config->useDefaultCalorimeterTypes();
- config->addInputFile(inputEvents);
- config->setOutputFile(outputEvents);
- config->setNumberOfEvents(nevents);
- config->setSkipEvents(skipEvents);
+ // Stop the job if command line arguments were not good.
+ if (error)
+ {
+ cout << "An error occurred while processing the command line options (see above). slicPandora will exit now!" << endl;
+ printUsage();
+ return 1;
+ }
// Make a new job manager.
JobManager* mgr = new JobManager();
@@ -107,5 +200,9 @@
mgr->addEventProcessor(new ResetPandoraProcessor());
// Run the job.
+ std::cout << "running..." << std::endl;
mgr->run();
+
+ // Return success.
+ return 0;
}
CVSspam 0.2.8