slicPandora/include
diff -N SlicPandoraPFANewProcessor.h
--- SlicPandoraPFANewProcessor.h 13 Jan 2010 02:47:00 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,111 +0,0 @@
-/*
- * File: SlicPandoraPFANewProcessor.h
- * Author: ngraf
- *
- * Created on December 1, 2009, 5:59 AM
- */
-
-#ifndef _SLICPANDORAPFANEWPROCESSOR_H
-#define _SLICPANDORAPFANEWPROCESSOR_H
-
-#include "EVENT/CalorimeterHit.h"
-#include "EVENT/SimCalorimeterHit.h"
-#include "EVENT/CalorimeterHit.h"
-#include "EVENT/Track.h"
-
-#include "StatusCodes.h"
-#include "Api/PandoraApi.h"
-#include "Objects/CartesianVector.h"
-#include "lcio.h"
-
-namespace pandora
-{
- class Pandora;
-}
-using namespace EVENT;
-
-// namespace pandora {class Pandora;}
-
-class SlicPandoraPFANewProcessor
-{
-public:
-
-public:
- typedef std::vector<std::string> StringVector;
- /**
- * @brief Settings class
- */
- class Settings
- {
- public:
- std::string m_pandoraSettingsXmlFile; ///< The pandora settings xml file
-
- StringVector m_trackCollections; ///< The reconstructed track collections
- StringVector m_v0VertexCollections; ///< The v0 vertex collections
- StringVector m_eCalCaloHitCollections; ///< The ecal calorimeter hit collections
- StringVector m_hCalCaloHitCollections; ///< The hcal calorimeter hit collections
- StringVector m_mcParticleCollections; ///< The mc particle collections
- StringVector m_lcCaloHitRelationCollections; ///< The SimCaloHit to CaloHit particle relations
- StringVector m_lcTrackRelationCollections; ///< The SimTrackerHit to TrackerHit particle relations
- std::string m_pfoCollectionName; ///< The name of the PFO output collection
- float m_absorberRadiationLength; ///< The absorber radation length
- float m_absorberInteractionLength; ///< The absorber interaction length
- float m_eCalToMip; ///< The calibration from deposited ECal energy to mip
- float m_hCalToMip; ///< The calibration from deposited HCal energy to mip
- float m_eCalMipThreshold; ///< Threshold for creating calo hits in the ECal, units mip
- float m_hCalMipThreshold; ///< Threshold for creating calo hits in the HCal, units mip
-
- float m_eCalToEMGeV; ///< The calibration from deposited ECal energy to EM energy
- float m_hCalToEMGeV; ///< The calibration from deposited HCal energy to EM energy
- float m_eCalToHadGeV; ///< The calibration from deposited ECal energy to hadronic energy
- float m_hCalToHadGeV; ///< The calibration from deposited HCal energy to hadronic energy
- int m_nHitsForHelixFits; ///< The number of hits to be used in helix fits at start/end of tracks
-
- int m_useEndTrackHelixForECalProjection; ///< Use end track fit or full track helix for ECal projection
- int m_useDcaAsReferencePointForProjection; ///< Use DCA as helix reference point for ECal projection
- };
-
- /**
- * @brief Default constructor
- */
- SlicPandoraPFANewProcessor(std::string xmlFileName);
-
- virtual ~SlicPandoraPFANewProcessor() {;}
- /**
- * @brief Initialize, called at startup
- */
- virtual void init(std::string xmlFileName);
- StatusCode registerUserAlgorithmFactories();
-
- void SetDefaultSubDetectorParameters(PandoraApi::GeometryParameters::SubDetectorParameters &subDetectorParameters) const;
- void SetEcalEndcapDetectorParameters(PandoraApi::GeometryParameters::SubDetectorParameters &subDetectorParameters) const;
- void SetHcalBarrelDetectorParameters(PandoraApi::GeometryParameters::SubDetectorParameters &subDetectorParameters) const;
-
- void processEvent(lcio::LCEvent* pLCEvent);
- void processParticleFlowObjects( lcio::LCEvent* pLCEvent);
- void CreateECalCaloHits(const LCEvent* const pLCEvent);
-
-private: // methods
- StatusCode createGeometry();
- PandoraApi::CaloHit::Parameters getCalHitParameters(CalorimeterHit* const hit) const;
- void printSimCalorimeterHit(SimCalorimeterHit* hit);
- void printCalorimeterHit(CalorimeterHit* hit);
-
-private: // attributes
- typedef std::vector<CalorimeterHit *> CalorimeterHitVector;
- typedef std::vector<Track *> TrackVector;
-
- pandora::Pandora *m_pPandora; ///< Address of the pandora instance
- Settings m_settings; ///< The settings for the pandora pfa new processor
- std::string m_detectorName; ///< The detector name
- unsigned int m_nRun; ///< The run number
- unsigned int m_nEvent; ///< The event number
- CalorimeterHitVector m_calorimeterHitVector; ///< The calorimeter hit vector
- TrackVector m_trackVector; ///< The track vector
-
- // cache the barrel normal vectors
- std::vector<pandora::CartesianVector*> _normalVectors;
-};
-
-#endif /* _SLICPANDORAPFANEWPROCESSOR_H */
-
slicPandora/src
diff -N SlicPandoraPFANewProcessor.cpp
--- SlicPandoraPFANewProcessor.cpp 10 Mar 2010 20:16:14 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,433 +0,0 @@
-#include "SlicPandoraPFANewProcessor.h"
-
-#include "EVENT/LCCollection.h"
-#include "EVENT/SimCalorimeterHit.h"
-#include "EVENT/CalorimeterHit.h"
-#include "IMPL/LCCollectionVec.h"
-#include "IMPL/ReconstructedParticleImpl.h"
-#include "IMPL/ClusterImpl.h"
-#include "IMPL/LCFlagImpl.h"
-#include "PfoConstructionAlgorithm.h"
-
-#include <cmath>
-
-using std::cout;
-using std::endl;
-
-using IMPL::LCCollectionVec;
-using IMPL::ReconstructedParticleImpl;
-using IMPL::ClusterImpl;
-using IMPL::LCFlagImpl;
-
-SlicPandoraPFANewProcessor::SlicPandoraPFANewProcessor(std::string xmlFileName)
-{
- std::cout << "SlicPandoraPFANewProcessor" << std::endl;
- init(xmlFileName);
-}
-
-void SlicPandoraPFANewProcessor::init(std::string xmlFileName)
-{
- m_pPandora = new pandora::Pandora();
-
- PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->createGeometry());
- PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->registerUserAlgorithmFactories());
- PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraApi::ReadSettings(*m_pPandora, xmlFileName));
-}
-
-StatusCode SlicPandoraPFANewProcessor::createGeometry()
-{
- cout << "*****************" << endl << "Creating Geometry" << endl;
- // try
- // {
- // // Insert user code here ...
- PandoraApi::Geometry::Parameters geometryParameters;
- //
- // const gear::TPCParameters &tpcParameters = marlin::Global::GEAR->getTPCParameters();
- // const gear::PadRowLayout2D &tpcPadLayout = tpcParameters.getPadLayout();
- geometryParameters.m_mainTrackerInnerRadius = 12.;
- geometryParameters.m_mainTrackerOuterRadius = 1264.;
- geometryParameters.m_mainTrackerZExtent = 1656.;
- //
- // const gear::GearParameters &coilParameters = marlin::Global::GEAR->getGearParameters("CoilParameters");
- geometryParameters.m_coilInnerRadius = 2591.;
- geometryParameters.m_coilOuterRadius = 3000.;
- geometryParameters.m_coilZExtent = 2933.;
- geometryParameters.m_bField = 5.0;
- //
- geometryParameters.m_nRadLengthsInZGap = 0;
- geometryParameters.m_nIntLengthsInZGap = 0;
- geometryParameters.m_nRadLengthsInRadialGap = 0;
- geometryParameters.m_nIntLengthsInRadialGap = 0;
- //
- // EM Calorimeter Barrel
- //
- int nSides = 12;
- double EcalBarrel_rmin = 1265.;
- geometryParameters.m_eCalBarrelParameters.m_innerRCoordinate = 1265.;
- geometryParameters.m_eCalBarrelParameters.m_innerZCoordinate = 1765.;
- geometryParameters.m_eCalBarrelParameters.m_innerPhiCoordinate = 0.;
- geometryParameters.m_eCalBarrelParameters.m_innerSymmetryOrder = nSides;
- // 126.5 + (.032 + .005 + .030 + .033) + ((.25 + .025 + .032 + .005 + .030 + .033) * 20) + ((.5 + .025 + .032 + .005 + .030 + .033) * 10)
- geometryParameters.m_eCalBarrelParameters.m_outerRCoordinate = 1403.5;
- geometryParameters.m_eCalBarrelParameters.m_outerZCoordinate = 1765.;
- geometryParameters.m_eCalBarrelParameters.m_outerPhiCoordinate = 0.;
- geometryParameters.m_eCalBarrelParameters.m_outerSymmetryOrder = nSides;
- geometryParameters.m_eCalBarrelParameters.m_nLayers = 31;
-
- // layer 0
-
- int tLayer = 0;
-
- PandoraApi::Geometry::Parameters::LayerParameters layerParameters;
- layerParameters.m_closestDistanceToIp = EcalBarrel_rmin + .032 / 2.;
- layerParameters.m_nRadiationLengths = 0.;
- layerParameters.m_nInteractionLengths = 0.;
- geometryParameters.m_eCalBarrelParameters.m_layerParametersList.push_back(layerParameters);
- cout << "layer: " << tLayer++ << " radius " << layerParameters.m_closestDistanceToIp.Get() << endl;
- // thin absorbers
- double offset = EcalBarrel_rmin + .032 + .005 + .030 + .033;
- for (int i = 0; i < 20; ++i)
- {
- PandoraApi::Geometry::Parameters::LayerParameters layerParameters;
- offset += 2.5 + .025 + .032 / 2.; // tungsten + air gap + half silicon thickness
- layerParameters.m_closestDistanceToIp = offset;
- cout << "layer: " << tLayer++ << " radius " << layerParameters.m_closestDistanceToIp.Get() << endl;
-
- offset += .032 / 2. + .005 + .030 + .033; // half silicon thickness + copper + kapton + air gap
- layerParameters.m_nRadiationLengths = 0.636;
- layerParameters.m_nInteractionLengths = 0.023;
- geometryParameters.m_eCalBarrelParameters.m_layerParametersList.push_back(layerParameters);
- }
-
- // thick absorbers
- for (int i = 0; i < 10; ++i)
- {
- PandoraApi::Geometry::Parameters::LayerParameters layerParameters;
- offset += 5.0 + .025 + .032 / 2.; // tungsten + air gap + half silicon thickness
- layerParameters.m_closestDistanceToIp = offset;
- cout << "layer: " << tLayer++ << " radius " << layerParameters.m_closestDistanceToIp.Get() << endl;
-
- offset += .032 / 2. + .005 + .030 + .033; // half silicon thickness + copper + kapton + air gap
- layerParameters.m_closestDistanceToIp = offset;
- layerParameters.m_nRadiationLengths = 1.27;
- layerParameters.m_nInteractionLengths = 0.046;
- geometryParameters.m_eCalBarrelParameters.m_layerParametersList.push_back(layerParameters);
- }
-
- cout << "layer list size " << geometryParameters.m_eCalBarrelParameters.m_layerParametersList.size() << endl;
-
- // set up the normal vectors by module
- double pi(std::acos(-1.));
- double dphi = -2 * pi / nSides;
- double phi0 = pi / 2.;
- double phi = phi0;
- for (int i = 0; i < nSides; ++i)
- {
- cout << "Module " << i << " x " << cos(phi) << " y " << sin(phi) << endl;
- _normalVectors.push_back(new pandora::CartesianVector(cos(phi), sin(phi), 0.));
- phi += dphi;
- }
- //TODO repeat for EM endcap, Had barrel & Had endcap.
- SetEcalEndcapDetectorParameters(geometryParameters.m_eCalEndCapParameters);
- SetHcalBarrelDetectorParameters(geometryParameters.m_hCalBarrelParameters);
- SetDefaultSubDetectorParameters(geometryParameters.m_hCalEndCapParameters);
-
-
- // // Non-default values (and those missing from GEAR parameters file)...
- geometryParameters.m_eCalEndCapParameters.m_innerSymmetryOrder = 12;
- geometryParameters.m_hCalBarrelParameters.m_outerPhiCoordinate = 0.;
- geometryParameters.m_hCalBarrelParameters.m_outerSymmetryOrder = 12;
- //
- // // Addition subdetectors
- // this->SetAdditionalSubDetectorParameters(geometryParameters);
- //
- cout << "done" << endl;
- PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraApi::Geometry::Create(*m_pPandora, geometryParameters));
- // }
- // catch (gear::UnknownParameterException &e)
- // {
- // streamlog_out(ERROR) << "Failed to extract geometry information from gear." << std::endl;
- // return STATUS_CODE_FAILURE;
- // }
- //
- // return STATUS_CODE_SUCCESS;
- cout << "returning" << endl;
- return STATUS_CODE_SUCCESS;
-}
-
-void SlicPandoraPFANewProcessor::processEvent(lcio::LCEvent* event)
-{
- std::cout << "processing event " << event->getEventNumber() << std::endl;
- CreateECalCaloHits(event);
- StatusCode stat = PandoraApi::ProcessEvent(*m_pPandora);
- if (stat == STATUS_CODE_SUCCESS)
- {
- cout << "Bingo!" << endl;
- processParticleFlowObjects(event);
- }
- // PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraApi::ProcessEvent(*m_pPandora));
- //stat = PandoraApi::Reset(*m_pPandora);
-}
-
-void SlicPandoraPFANewProcessor::processParticleFlowObjects(lcio::LCEvent* pLCEvent)
-{
- // first a container for the clusters...
- LCCollectionVec* clusterVec = new LCCollectionVec(LCIO::CLUSTER);
- // if we want to point back to the hits we need to set the flag
- LCFlagImpl clusterFlag(0);
- clusterFlag.setBit(LCIO::CLBIT_HITS);
- clusterVec->setFlag(clusterFlag.getFlag());
-
- // get the particle flow objects
- pandora::ParticleFlowObjectList particleFlowObjectList;
- PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraApi::GetParticleFlowObjects(*m_pPandora,
- particleFlowObjectList));
-
- LCCollectionVec* pReconstructedParticleCollection = new LCCollectionVec(LCIO::RECONSTRUCTEDPARTICLE);
-
- // get particle flow objects and create "reconstructed particles"
- for (pandora::ParticleFlowObjectList::iterator itPFO = particleFlowObjectList.begin(), itPFOEnd = particleFlowObjectList.end();
- itPFO != itPFOEnd; ++itPFO)
- {
- ReconstructedParticleImpl *pReconstructedParticle = new ReconstructedParticleImpl();
-
- pandora::ClusterAddressList clusterAddressList = (*itPFO)->GetClusterAddressList();
- cout << "Found " << clusterAddressList.size() << " clusters." << endl;
- pandora::TrackAddressList trackAddressList = (*itPFO)->GetTrackAddressList();
-
- // make LCIO clusters
- for (pandora::ClusterAddressList::iterator itCluster = clusterAddressList.begin(), itClusterEnd = clusterAddressList.end();
- itCluster != itClusterEnd; ++itCluster)
- {
- ClusterImpl *pCluster = new ClusterImpl();
-
- double clusterEnergy = 0.;
- float* clusterPosition;
- double maxE = 0;
- for (pandora::CaloHitAddressList::iterator itHit = (*itCluster).begin(), itHitEnd = (*itCluster).end(); itHit != itHitEnd; ++itHit)
- {
-
- clusterEnergy += ((CalorimeterHit*) (*itHit))->getEnergy();
- if(((CalorimeterHit*) (*itHit))->getEnergy()>maxE)
- {
- maxE = ((CalorimeterHit*) (*itHit))->getEnergy();
- //avert your gaze...
- clusterPosition = const_cast<float*>(((CalorimeterHit*) (*itHit))->getPosition());
- }
- pCluster->addHit((CalorimeterHit*) (*itHit), 1.0); // transform from Uid (=void*) to a CalorimeterHit*
- }
- pCluster->setEnergy(clusterEnergy);
- pCluster->setPosition(clusterPosition);
- cout << "Cluster contains " << pCluster->getCalorimeterHits().size() << " hits" << endl;
- // add this cluster to the collection
- clusterVec->addElement(pCluster);
- pReconstructedParticle->addCluster(pCluster);
- }
-
- // add tracks
- for (pandora::TrackAddressList::iterator itTrack = trackAddressList.begin(), itTrackEnd = trackAddressList.end(); itTrack != itTrackEnd;
- ++itTrack)
- {
- pReconstructedParticle->addTrack((Track*) (*itTrack));
- }
-
- float momentum[3] = {(*itPFO)->GetMomentum().GetX(), (*itPFO)->GetMomentum().GetY(), (*itPFO)->GetMomentum().GetZ()};
- pReconstructedParticle->setMomentum(momentum);
- pReconstructedParticle->setEnergy((*itPFO)->GetEnergy());
- pReconstructedParticle->setMass((*itPFO)->GetMass());
- pReconstructedParticle->setCharge((*itPFO)->GetCharge());
- pReconstructedParticle->setType((*itPFO)->GetParticleId());
-
- pReconstructedParticleCollection->addElement(pReconstructedParticle);
- }
- // add the list of clusters to the event
- pLCEvent->addCollection(clusterVec, "SomeClusters");
- cout << "end of loop over pandora outpout" << endl;
- pLCEvent->addCollection(pReconstructedParticleCollection, "PandoraPFOCollection");
- cout << "added pfo objects to event" << endl;
-}
-
-PandoraApi::CaloHit::Parameters SlicPandoraPFANewProcessor::getCalHitParameters(CalorimeterHit * const hit) const
-{
- unsigned int layer = ((hit->getCellID0() >> 13) & 0x7f);
- int module = ((hit->getCellID0() >> 9) & 0xF);
- const float* pos(hit->getPosition());
-
- PandoraApi::CaloHit::Parameters params;
- // pandora::InputCartesianVector m_positionVector; ///< Position vector of center of calorimeter cell, units mm
- params.m_positionVector = pandora::CartesianVector(pos[0], pos[1], pos[2]);
-
- // pandora::InputCartesianVector m_normalVector; ///< Unit normal to sampling layer, pointing outwards from the origin
- params.m_normalVector = *(_normalVectors.at(module));
-
- // pandora::InputFloat m_cellSizeU; ///< Dimension of cell (up in ENDCAP, along beam in BARREL), units mm
- params.m_cellSizeU = 3.5;
-
- // pandora::InputFloat m_cellSizeV; ///< Dimension of cell (perpendicular to u and thickness), units mm
- params.m_cellSizeV = 3.5;
-
- // pandora::InputFloat m_cellThickness; ///< Thickness of cell, units mm
- params.m_cellThickness = .32; // TODO check that this is meant to be the readout thickness.
-
- // pandora::InputFloat m_nRadiationLengths; ///< Absorber material in front of cell, units radiation lengths
- params.m_nRadiationLengths = (layer < 21 ? 0.636 : 1.27);
-
- // pandora::InputFloat m_nInteractionLengths; ///< Absorber material in front of cell, units interaction lengths
- params.m_nInteractionLengths = (layer < 21 ? 0.023 : 0.046);
-
- // pandora::InputFloat m_time; ///< Time of (earliest) energy deposition in this cell, units ns
- params.m_time = hit->getTime();
-
- // pandora::InputFloat m_inputEnergy; ///< Corrected energy of calorimeter cell in user framework, units GeV
- params.m_inputEnergy = hit->getEnergy(); //TODO apply sampling fraction
-
- // pandora::InputFloat m_mipEquivalentEnergy; ///< The calibrated mip equivalent energy, units mip
- params.m_mipEquivalentEnergy = 1.0; //TODO calibrate to muon signal
-
- // pandora::InputFloat m_electromagneticEnergy; ///< The calibrated electromagnetic energy measure, units GeV
- params.m_electromagneticEnergy = hit->getEnergy();
-
- // pandora::InputFloat m_hadronicEnergy; ///< The calibrated hadronic energy measure, units GeV
- params.m_hadronicEnergy = hit->getEnergy();
-
- // pandora::InputBool m_isDigital; ///< Whether cell should be treated as digital
- params.m_isDigital = false;
-
- // pandora::InputHitType m_hitType; ///< The type of calorimeter hit
- params.m_hitType = pandora::ECAL;
-
- // pandora::InputDetectorRegion m_detectorRegion; ///< Region of the detector in which the calo hit is located
- params.m_detectorRegion = pandora::BARREL;
-
- // pandora::InputUInt m_layer; ///< The subdetector readout layer number
- params.m_layer = layer;
-
- // pandora::InputAddress m_pParentAddress; ///< Address of the parent calo hit in the user framework
- params.m_pParentAddress = hit; //TODO make sure this doesn't break anything since it is SimCalorimeterHit, not CalorimeterHit
-
- return params;
-}
-
-void SlicPandoraPFANewProcessor::CreateECalCaloHits(const LCEvent * const pLCEvent)
-{
- std::string collectionToFetch = "CalorimeterHits";
- // std::string collectionToFetch = "EcalBarrelHits";
- const LCCollection *pCaloHitCollection = pLCEvent->getCollection(collectionToFetch);
- int nHits = pCaloHitCollection->getNumberOfElements();
- std::cout << collectionToFetch << " contains " << nHits << " hits" << std::endl;
- for (int i = 0; i < pCaloHitCollection->getNumberOfElements(); ++i)
- {
- CalorimeterHit *pCaloHit = dynamic_cast<CalorimeterHit*> (pCaloHitCollection->getElementAt(i));
- // m_calorimeterHitVector.push_back(pCaloHit);
- //printSimCalorimeterHit(pCaloHit);
- //printCalorimeterHit(pCaloHit);
- PandoraApi::CaloHit::Parameters caloHitParameters = getCalHitParameters(pCaloHit);
- //std::cout << "hit layer " << caloHitParameters.m_layer.Get() << std::endl;
- PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraApi::CaloHit::Create(*m_pPandora, caloHitParameters));
- }
-}
-
-void SlicPandoraPFANewProcessor::printSimCalorimeterHit(SimCalorimeterHit* hit)
-{
- cout << endl;
- cout << " ID0 " << hit->getCellID0() << endl;
- cout << " ID1 " << hit->getCellID1() << endl;
- cout << " Energy " << hit->getEnergy() << endl;
- const float* pos(hit->getPosition());
- cout << " Pos " << pos[0] << " " << pos[1] << " " << pos[2] << endl;
- cout << " Time " << hit->getTimeCont(0) << endl;
- cout << " Layer " << ((hit->getCellID0() >> 13) & 0x7f) << endl;
- cout << " Module " << ((hit->getCellID0() >> 9) & 0xF) << endl;
-}
-
-void SlicPandoraPFANewProcessor::printCalorimeterHit(CalorimeterHit* hit)
-{
- cout << endl;
- cout << " ID0 " << hit->getCellID0() << endl;
- cout << " ID1 " << hit->getCellID1() << endl;
- cout << " Energy " << hit->getEnergy() << endl;
- const float* pos(hit->getPosition());
- cout << " Pos " << pos[0] << " " << pos[1] << " " << pos[2] << endl;
- cout << " Time " << hit->getTime() << endl;
- cout << " Layer " << ((hit->getCellID0() >> 13) & 0x7f) << endl;
- cout << " Module " << ((hit->getCellID0() >> 9) & 0xF) << endl;
-}
-
-void SlicPandoraPFANewProcessor::SetDefaultSubDetectorParameters(PandoraApi::GeometryParameters::SubDetectorParameters &subDetectorParameters) const
-{
- int nLayers = 1;
- subDetectorParameters.m_innerRCoordinate = 0.;
- subDetectorParameters.m_innerZCoordinate = 0.;
- subDetectorParameters.m_innerPhiCoordinate = 0.;
- subDetectorParameters.m_innerSymmetryOrder = 0;
- subDetectorParameters.m_outerRCoordinate = 0.;
- subDetectorParameters.m_outerZCoordinate = 0.;
- subDetectorParameters.m_outerPhiCoordinate = 0.;
- subDetectorParameters.m_outerSymmetryOrder = 0;
- subDetectorParameters.m_nLayers = nLayers;
-
- for (int i = 0; i < nLayers; ++i)
- {
- PandoraApi::Geometry::Parameters::LayerParameters layerParameters;
- layerParameters.m_closestDistanceToIp = 0.;
- layerParameters.m_nRadiationLengths = 0.;
- layerParameters.m_nInteractionLengths = 0.;
- subDetectorParameters.m_layerParametersList.push_back(layerParameters);
- }
-}
-
-void SlicPandoraPFANewProcessor::SetEcalEndcapDetectorParameters(PandoraApi::GeometryParameters::SubDetectorParameters &subDetectorParameters) const
-{
- int nLayers = 1;
- subDetectorParameters.m_innerRCoordinate = 0.;
- subDetectorParameters.m_innerZCoordinate = 1657.0;
- subDetectorParameters.m_innerPhiCoordinate = 0.;
- subDetectorParameters.m_innerSymmetryOrder = 0;
- subDetectorParameters.m_outerRCoordinate = 0.;
- subDetectorParameters.m_outerZCoordinate = 0.;
- subDetectorParameters.m_outerPhiCoordinate = 0.;
- subDetectorParameters.m_outerSymmetryOrder = 0;
- subDetectorParameters.m_nLayers = nLayers;
-
- for (int i = 0; i < nLayers; ++i)
- {
- PandoraApi::Geometry::Parameters::LayerParameters layerParameters;
- layerParameters.m_closestDistanceToIp = 0.;
- layerParameters.m_nRadiationLengths = 0.;
- layerParameters.m_nInteractionLengths = 0.;
- subDetectorParameters.m_layerParametersList.push_back(layerParameters);
- }
-}
-
-void SlicPandoraPFANewProcessor::SetHcalBarrelDetectorParameters(PandoraApi::GeometryParameters::SubDetectorParameters &subDetectorParameters) const
-{
- int nLayers = 40;
- subDetectorParameters.m_innerRCoordinate = 1419.0;
- subDetectorParameters.m_innerZCoordinate = 3018.0;
- subDetectorParameters.m_innerPhiCoordinate = 0.;
- subDetectorParameters.m_innerSymmetryOrder = 12;
- subDetectorParameters.m_outerRCoordinate = 2495.0; //40*(18.9+1.1+1.2+1.1+3.0+1.6)+1419
- subDetectorParameters.m_outerZCoordinate = 3018.0;
- subDetectorParameters.m_outerPhiCoordinate = 0.;
- subDetectorParameters.m_outerSymmetryOrder = 12;
- subDetectorParameters.m_nLayers = nLayers;
-
- double layerThickness = 18.9 + 1.1 + 1.2 + 1.1 + 3.0 + 1.6; // 26.9 Steel+glass+gas+glass+g10+air
- double offset = 1419.0 + 18.9 + 1.1 + 1.2 / 2.; // rmin + steel + glass + half gas thickness
- for (int i = 0; i < nLayers; ++i)
- {
- PandoraApi::Geometry::Parameters::LayerParameters layerParameters;
- layerParameters.m_closestDistanceToIp = offset;
- offset += layerThickness;
- layerParameters.m_nRadiationLengths = 1.0; //TODO fix this
- layerParameters.m_nInteractionLengths = 1.0; //TODO fix this
- subDetectorParameters.m_layerParametersList.push_back(layerParameters);
- }
-}
-
-StatusCode SlicPandoraPFANewProcessor::registerUserAlgorithmFactories()
-{
- pandora::AlgorithmFactory* pfac = new PfoConstructionAlgorithm::Factory();
- PandoraApi::RegisterAlgorithmFactory(*m_pPandora, "PFO_Construction", pfac);
- return STATUS_CODE_SUCCESS;
-}