1 added + 10 modified, total 11 files
slicPandora
diff -u -r1.2 -r1.3
--- make_setup_script.sh 7 Jun 2010 16:56:08 -0000 1.2
+++ make_setup_script.sh 8 Jun 2010 21:43:01 -0000 1.3
@@ -15,6 +15,13 @@
echo -e \
"#!/bin/bash
-export PANDORAPFA=$PANDORAPFA
-export LCIO=$LCIO
-export LD_LIBRARY_PATH=${PANDORAPFA}/lib:${LCIO}/lib:${PWD}/lib:\$LD_LIBRARY_PATH" > mysetup.sh
+export PANDORAPFA=$PANDORAPFA" > mysetup.sh
+
+if [ -n "$PANDORA_RELEASE" ]; then
+ echo "PANDORA_RELEASE=$PANDORA_RELEASE"
+ echo "export PANDORA_RELEASE=$PANDORA_RELEASE" >> mysetup.sh
+fi
+
+echo -e \
+"export LCIO=$LCIO
+export LD_LIBRARY_PATH=${PANDORAPFA}/lib:${LCIO}/lib:${PWD}/lib:\$LD_LIBRARY_PATH" >> mysetup.sh
slicPandora
diff -u -r1.12 -r1.13
--- Makefile 11 Mar 2010 22:19:13 -0000 1.12
+++ Makefile 8 Jun 2010 21:43:01 -0000 1.13
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.12 2010/03/11 22:19:13 jeremy Exp $
+# $Id: Makefile,v 1.13 2010/06/08 21:43:01 jeremy Exp $
#
# Makefile for the slicPandora project. It requires that
@@ -50,8 +50,19 @@
TESTS=$(basename $(notdir $(TESTSRCS)))
# compiler flags
+#CXXFLAGS=-v -Wall -g $(INCLUDES)
CXXFLAGS=-Wall -g $(INCLUDES)
+# Compile for release version.
+ifdef PANDORA_RELEASE
+CXXFLAGS+="-DPANDORA_RELEASE="$(PANDORA_RELEASE)
+endif
+
+# Debug output for PFO creation.
+ifdef PFOPROCESSOR_DEBUG
+CXXFLAGS+="-DPFOPROCESSOR_DEBUG=1"
+endif
+
# Create library and tests.
all: libs tests
@@ -96,4 +107,4 @@
# Clean up the object files and build directories.
clean:
- @rm -rf $(OBJS) $(PWD)/lib $(PWD)/bin
\ No newline at end of file
+ @rm -rf $(OBJS) $(PWD)/lib $(PWD)/bin
slicPandora/examples
diff -N PandoraSettingsRelease.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ PandoraSettingsRelease.xml 8 Jun 2010 21:43:02 -0000 1.1
@@ -0,0 +1,85 @@
+<!-- Pandora settings xml file -->
+<pandora>
+
+ <IsMonitoringEnabled> true </IsMonitoringEnabled>
+ <MipNCellsForNearbyHit> 2 </MipNCellsForNearbyHit>
+ <IsolationDensityWeightCutECal> 0.1 </IsolationDensityWeightCutECal>
+ <IsolationDensityWeightCutHCal> 0.1 </IsolationDensityWeightCutHCal>
+ <ShouldUseSimpleIsolationScheme> false </ShouldUseSimpleIsolationScheme>
+ <IsolationCutDistanceECal> 25. </IsolationCutDistanceECal>
+ <IsolationCutDistanceHCal> 200. </IsolationCutDistanceHCal>
+ <IsolationMaxNearbyHits> 2 </IsolationMaxNearbyHits>
+
+ <!-- Select the tracks to use for clustering -->
+ <algorithm type = "TrackSelection"></algorithm>
+
+ <!-- Primary clustering algorithm runs Clustering algorithm -->
+ <algorithm type = "PrimaryClustering">
+ <algorithm type = "Clustering" description = "ClusterFormation" instance = "mainClustering"/>
+
+ <!-- Topological associations, to be run after clustering -->
+ <algorithm type = "TopologicalAssociation" description = "ClusterAssociation" instance = "mainTopologicalAssoc">
+ <associationAlgorithms>
+ <algorithm type = "LoopingTracks"/>
+ <algorithm type = "BrokenTracks"/>
+ <algorithm type = "ShowerMipMerging"/>
+ <algorithm type = "ShowerMipMerging2"/>
+ <algorithm type = "BackscatteredTracks"/>
+ <algorithm type = "BackscatteredTracks2"/>
+ <algorithm type = "ShowerMipMerging3"/>
+ <algorithm type = "ShowerMipMerging4"/>
+ <algorithm type = "ProximityBasedMerging">
+ <algorithm type = "TrackClusterAssociation"/>
+ </algorithm>
+ <algorithm type = "ConeBasedMerging">
+ <algorithm type = "TrackClusterAssociation"/>
+ </algorithm>
+ <algorithm type = "SoftClusterMerging">
+ <algorithm type = "TrackClusterAssociation"/>
+ <ShouldUsePhotonClusters> false </ShouldUsePhotonClusters>
+ <PhotonClusterListName> photonClusters </PhotonClusterListName>
+ </algorithm>
+ <algorithm type = "IsolatedHitMerging">
+ <ShouldUsePhotonClusters> false </ShouldUsePhotonClusters>
+ <PhotonClusterListName> photonClusters </PhotonClusterListName>
+ </algorithm>
+ </associationAlgorithms>
+ </algorithm>
+ <ClusterListName> PrimaryClusterList </ClusterListName>
+ </algorithm>
+
+ <!-- Photon recovery -->
+ <algorithm type = "PhotonRecovery">
+ <algorithm type = "TrackClusterAssociation"/>
+ </algorithm>
+
+ <algorithm type = "ClusterPreparation" description = "ClusterPreparation">
+ <CandidateListNames>PrimaryClusterList</CandidateListNames>
+ </algorithm>
+
+ <algorithm type = "TrackPreparation" description = "TrackPreparation">
+ <trackClusterAssociationAlgorithms>
+ <algorithm type = "TrackClusterAssociation"/>
+ <algorithm type = "LoopingTrackAssociation"/>
+ <algorithm type = "TrackRecovery"/>
+ <algorithm type = "TrackRecoveryHelix"/>
+ <algorithm type = "TrackRecoveryInteractions"/>
+ </trackClusterAssociationAlgorithms>
+ </algorithm>
+
+ <algorithm type = "FragmentRemoval" description = "FragmentRemoval">
+ <fragmentRemovalAlgorithms>
+ <algorithm type = "MainFragmentRemoval"/>
+ <algorithm type = "NeutralFragmentRemoval"/>
+ </fragmentRemovalAlgorithms>
+ </algorithm>
+
+ <algorithm type = "PfoCreation" description = "PfoCreation">
+ </algorithm>
+
+ <algorithm type = "ForceSplitTrackAssociations"/>
+
+ <!-- Final particle id for particle flow objects -->
+ <algorithm type = "FinalParticleId"/>
+
+</pandora>
slicPandora/src
diff -u -r1.7 -r1.8
--- CalorimeterHitProcessor.cpp 19 May 2010 22:25:41 -0000 1.7
+++ CalorimeterHitProcessor.cpp 8 Jun 2010 21:43:02 -0000 1.8
@@ -1,4 +1,4 @@
-// $Id: CalorimeterHitProcessor.cpp,v 1.7 2010/05/19 22:25:41 jeremy Exp $
+// $Id: CalorimeterHitProcessor.cpp,v 1.8 2010/06/08 21:43:02 jeremy Exp $
#include "CalorimeterHitProcessor.h"
@@ -22,7 +22,7 @@
void CalorimeterHitProcessor::processEvent(EVENT::LCEvent* event)
{
- //std::cout << "CalorimeterHitProcessor::processEvent" << std::endl;
+ m_totalEHits = 0.;
const pandora::Pandora& pandora = getJobManager()->getPandora();
DetectorGeometry* geom = getJobManager()->getDetectorGeometry();
@@ -60,7 +60,9 @@
std::cout << "-----------------------------------------------------" << std::endl;
#endif
}
-
+
+ std::cout << "totalEHits: " << m_totalEHits << std::endl;
+ m_totalEHits = 0;
}
PandoraApi::CaloHit::Parameters CalorimeterHitProcessor::makeCaloHitParameters(
@@ -68,6 +70,9 @@
DetectorGeometry::ExtraSubDetectorParameters* xsubdet,
CalorimeterHit* hit)
{
+ // Create a new, empty CaloHit Parameters.
+ PandoraApi::CaloHit::Parameters params;
+
// Get the IDDecoder.
IDDecoder* decoder = xsubdet->m_decoder;
@@ -79,48 +84,82 @@
// Get the layer parameters for this layer.
PandoraApi::GeometryParameters::LayerParametersList* layerList = &(subdet->m_layerParametersList);
+ int nlayers = layerList->size();
+
+#if PANDORA_RELEASE >= 1
+ // Set isInOuterSamplingLayer if hit is in the last 2 layers.
+ if (layer >= nlayers - 3)
+ {
+ params.m_isInOuterSamplingLayer = true;
+ }
+ else
+ {
+ params.m_isInOuterSamplingLayer = false;
+ }
+#endif
+
PandoraApi::GeometryParameters::LayerParameters layerParams = (*layerList)[layer];
DetectorGeometry::ExtraLayerParameters xlayerParams = xsubdet->m_extraLayerParams[layer];
+ // Mip Energy.
float mipEnergy = xsubdet->m_mipEnergy.Get();
+ // Sampling fractions.
float samplingFraction = xlayerParams.m_samplingFraction.Get();
float emSamplingFraction = xlayerParams.m_emSamplingFraction.Get();
float hadSamplingFraction = xlayerParams.m_hadSamplingFraction.Get();
- // Recover raw energy to apply EM and HAD sampling fractions.
- float rawEnergy = hit->getEnergy() * samplingFraction;
+ // Recover the raw energy with reverse calculation.
+ // Should work for both digital and analog because sampling fraction
+ // is applied in SimCalorimeterHitProcessor for both places.
+ float rawEnergy = hit->getEnergy() * samplingFraction;
// Get the module number.
int module = decoder->getFieldValue("module", cellId);
- // Create a new, empty CaloHit Parameters.
- PandoraApi::CaloHit::Parameters params;
-
// Get the hit position.
- const float* pos(hit->getPosition());
-
- //
- // Setup a CaloHit::Parameters object for this CalorimeterHit.
- //
+ const float* pos(hit->getPosition());
// Position in mm.
params.m_positionVector = pandora::CartesianVector(pos[0], pos[1], pos[2]);
- // Hit energy in GeV.
- params.m_inputEnergy = hit->getEnergy();
+ // Digital calorimeter setting.
+ params.m_isDigital = xsubdet->m_isDigital;
- // EM energy in GeV.
- params.m_electromagneticEnergy = rawEnergy / emSamplingFraction;
+ // For digital hits, divide 1 by the sampling fraction.
+ if (params.m_isDigital.Get() == true)
+ {
+ // Hit energy in GeV.
+ params.m_inputEnergy = 1. / samplingFraction;
- // HAD energy in GeV.
- params.m_hadronicEnergy = rawEnergy / hadSamplingFraction;
+ // EM energy in GeV.
+ params.m_electromagneticEnergy = 1. / emSamplingFraction;
+
+ // HAD energy in GeV.
+ params.m_hadronicEnergy = 1. / hadSamplingFraction;
+
+ // MIP equivalent energy.
+ params.m_mipEquivalentEnergy = 1. / mipEnergy;
+ }
+ // For analog hits, divide the raw energy by the sampling fraction.
+ else
+ {
+ // Hit energy in GeV. Sampling fraction applied in SimCalorimeterHitProcessor.
+ params.m_inputEnergy = hit->getEnergy();
- // MIP equivalent energy.
- params.m_mipEquivalentEnergy = rawEnergy / mipEnergy;
+ // EM energy in GeV.
+ params.m_electromagneticEnergy = rawEnergy / emSamplingFraction;
+
+ // HAD energy in GeV.
+ params.m_hadronicEnergy = rawEnergy / hadSamplingFraction;
+
+ // MIP equivalent energy.
+ params.m_mipEquivalentEnergy = rawEnergy / mipEnergy;
+ }
- // Digital calorimeter setting.
- params.m_isDigital = xsubdet->m_isDigital;
+ // DEBUG
+ m_totalEHits += params.m_inputEnergy.Get();
+ // END DEBUG
// Layer number.
params.m_layer = layer;
slicPandora/src
diff -u -r1.13 -r1.14
--- DetectorGeometry.cpp 7 Jun 2010 22:43:22 -0000 1.13
+++ DetectorGeometry.cpp 8 Jun 2010 21:43:02 -0000 1.14
@@ -27,8 +27,6 @@
void DetectorGeometry::loadFromFile(std::string filename)
{
- //std::cout << "DetectorGeometry::loadFromFile()" << std::endl;
-
// Load doc and check if valid.
TiXmlDocument doc(filename.c_str());
if (!doc.LoadFile())
@@ -54,13 +52,15 @@
PandoraApi::GeometryParameters::SubDetectorParameters* subdet =
getSubDetectorFromType(subdetType);
- ExtraSubDetectorParameters extras;
-
- if (subdet == 0)
+ // Check if subdetector type is known and skip if not.
+ if (0 == subdet)
{
- std::cerr << "FATAL ERROR: Could not find subdetector with type " << subdetType << ". Exiting!" << std::endl;
- exit(1);
- }
+ std::cerr << "WARNING: Ignoring unknown subdetType " << subdetType << "." << std::endl;
+ continue;
+ }
+
+ // Extra parameters defined by the GeomConverter format.
+ ExtraSubDetectorParameters extras;
// Numerical parameters which are attributes on calorimeter.
float innerR, innerZ, innerPhi;
@@ -99,6 +99,13 @@
subdet->m_outerPhiCoordinate = outerPhi;
subdet->m_outerSymmetryOrder = outerSym;
+ // Inner and outer symmetry are different.
+ if (innerSym != outerSym)
+ {
+ std::cerr << "Inner and outer symmetry are different. Don't know how to handle this case!" << std::endl;
+ exit(1);
+ }
+
// Number of layers.
TiXmlElement* layers = (TiXmlElement*) calElem->FirstChild("layers");
layers->QueryIntAttribute("nlayers", &nlayers);
@@ -191,21 +198,13 @@
// Make an IDDecoder for this calorimeter.
IDDecoder* decoder = new IDDecoder(fields);
+ extras.m_decoder = decoder;
// Set extra subdetector parameters.
- extras.m_decoder = decoder;
extras.m_inputHitType = getHitType(subdetType);
extras.m_inputDetectorRegion = getDetectorRegion(subdetType);
extras.m_mipEnergy = mipEnergy;
-
-
-
- if (innerSym != outerSym)
- {
- std::cerr << "Inner and outer symmetry are different. Don't know how to handle this case!" << std::endl;
- exit(1);
- }
-
+
// Calculate the subdetector normal vectors for a barrel region.
if (extras.m_inputDetectorRegion.Get() == pandora::BARREL)
{
@@ -321,12 +320,20 @@
{
return &(geom.m_hCalEndCapParameters);
}
+#if PANDORA_RELEASE >= 1
+ else if ( strcmp( subdetType, "MUON_BARREL" ) == 0 )
+ {
+ return &(geom.m_muonBarrelParameters);
+ }
+ else if ( strcmp( subdetType, "MUON_ENDCAP" ) == 0 )
+ {
+ return &(geom.m_muonEndCapParameters);
+ }
+#endif
else
{
- runtime_error("Unknown subdetector type.");
+ return 0;
}
- // Next line removes compilation warning. Code should never get here!
- return 0;
}
void DetectorGeometry::printOut(const char* subdetType, PandoraApi::GeometryParameters::SubDetectorParameters* subdet)
@@ -379,7 +386,13 @@
else if (calType == "HAD_BARREL" || calType == "HAD_ENDCAP")
{
return pandora::HCAL;
+ }
+#if PANDORA_RELEASE >= 1
+ else if (calType == "MUON_BARREL" || calType == "MUON_ENDCAP")
+ {
+ return pandora::MUON;
}
+#endif
else
{
std::cout << "Unknown CalorimeterType <" << calType << ">." << std::endl;
@@ -388,11 +401,11 @@
inline pandora::InputDetectorRegion DetectorGeometry::getDetectorRegion(const std::string& calType) const
{
- if (calType == "EM_BARREL" || calType == "HAD_BARREL")
+ if (calType == "EM_BARREL" || calType == "HAD_BARREL" || calType == "MUON_BARREL")
{
return pandora::BARREL;
}
- else if (calType == "EM_ENDCAP" || calType == "HAD_ENDCAP")
+ else if (calType == "EM_ENDCAP" || calType == "HAD_ENDCAP" || calType == "MUON_ENDCAP")
{
return pandora::ENDCAP;
}
slicPandora/src
diff -u -r1.2 -r1.3
--- PfoConstructionAlgorithm.cpp 10 Mar 2010 20:16:14 -0000 1.2
+++ PfoConstructionAlgorithm.cpp 8 Jun 2010 21:43:02 -0000 1.3
@@ -4,6 +4,9 @@
* @brief Implementation of the pfo construction algorithm class.
*
* $Log: PfoConstructionAlgorithm.cpp,v $
+ * Revision 1.3 2010/06/08 21:43:02 jeremy
+ * make compatible with Pandora release1 (set PANDORA_RELEASE macro to enable); add basic code for digital calorimetry
+ *
* Revision 1.2 2010/03/10 20:16:14 jeremy
* updates to compile against PandoraPFANew svn trunk; update example setup script; a few small changes to JobManagerTest
*
@@ -12,7 +15,9 @@
*
*/
-#include "Algorithms/PfoConstructionAlgorithm.h"
+#include "PfoConstructionAlgorithm.h"
+
+#include "Api/PandoraApi.h"
using namespace pandora;
slicPandora/src
diff -u -r1.11 -r1.12
--- PfoProcessor.cpp 26 May 2010 21:00:59 -0000 1.11
+++ PfoProcessor.cpp 8 Jun 2010 21:43:02 -0000 1.12
@@ -1,4 +1,4 @@
-// $Id: PfoProcessor.cpp,v 1.11 2010/05/26 21:00:59 ngraf Exp $
+// $Id: PfoProcessor.cpp,v 1.12 2010/06/08 21:43:02 jeremy Exp $
#include "PfoProcessor.h"
// lcio
@@ -29,7 +29,7 @@
using std::endl;
// Uncomment for debugging output.
-#define PFOPROCESSOR_DEBUG 1
+// #define PFOPROCESSOR_DEBUG 1
PfoProcessor::PfoProcessor()
: EventProcessor("PfoProcessor")
@@ -40,10 +40,6 @@
void PfoProcessor::processEvent(EVENT::LCEvent* event)
{
-#ifdef PFOPROCESSOR_DEBUG
- std::cout << "PfoProcessor::processEvent" << std::endl;
-#endif
-
// Make a container for the clusters.
LCCollectionVec* clusterVec = new LCCollectionVec(EVENT::LCIO::CLUSTER);
@@ -55,7 +51,7 @@
// Get Pandora's list of PFOs.
pandora::ParticleFlowObjectList particleFlowObjectList;
PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraApi::GetParticleFlowObjects(getJobManager()->getPandora(),
- particleFlowObjectList));
+ particleFlowObjectList));
#ifdef PFOPROCESSOR_DEBUG
std::cout << "Pandora found " << particleFlowObjectList.size() << " PFOs in event <" << event->getEventNumber() << ">." << std::endl;
#endif
@@ -87,15 +83,11 @@
// Iterate over the cluster list and make LCIO clusters.
for (pandora::ClusterAddressList::iterator itCluster = clusterAddressList.begin(), itClusterEnd = clusterAddressList.end();
- itCluster != itClusterEnd; ++itCluster)
+ itCluster != itClusterEnd; ++itCluster)
{
// Make a new Cluster.
ClusterImpl *pCluster = new ClusterImpl();
- //double clusterEnergy = 0.;
- //float* clusterPosition;
- //double maxE = 0;
-
const unsigned int nHitsInCluster((*itCluster).size());
float clusterEnergy(0.);
@@ -106,8 +98,6 @@
for (unsigned int iHit = 0; iHit < nHitsInCluster; ++iHit)
{
- //for (pandora::CaloHitAddressList::iterator itHit = (*itCluster).begin(), itHitEnd = (*itCluster).end(); itHit != itHitEnd; ++itHit)
- //{
CalorimeterHit *pCalorimeterHit = (CalorimeterHit*)((*itCluster)[iHit]);
pCluster->addHit(pCalorimeterHit, 1.0);
@@ -117,16 +107,7 @@
pHitE[iHit] = caloHitEnergy;
pHitX[iHit] = pCalorimeterHit->getPosition()[0];
pHitY[iHit] = pCalorimeterHit->getPosition()[1];
- pHitZ[iHit] = pCalorimeterHit->getPosition()[2];
-
- //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*
+ pHitZ[iHit] = pCalorimeterHit->getPosition()[2];
}
pCluster->setEnergy(clusterEnergy);
@@ -134,13 +115,7 @@
ClusterShapes *pClusterShapes = new ClusterShapes(nHitsInCluster, pHitE, pHitX, pHitY, pHitZ);
pCluster->setPosition(pClusterShapes->getCentreOfGravity());
- // TODO Set IPhi and ITheta.
-
- // Set cluster energy.
- //pCluster->setEnergy(clusterEnergy);
-
- // Set the cluster position.
- //pCluster->setPosition(clusterPosition);
+ // TODO Set IPhi and ITheta here.
#ifdef PFOPROCESSOR_DEBUG
cout << "Cluster contains <" << pCluster->getCalorimeterHits().size() << "> hits." << endl;
@@ -158,8 +133,8 @@
// Set the ReconstructedParticle parameters from the PFO.
#ifdef PFOPROCESSOR_DEBUG
- std::cout << "PFO momentum " << (*itPFO)->GetMomentum().GetX()<< " " << (*itPFO)->GetMomentum().GetY()<< " " << (*itPFO)->GetMomentum().GetZ() << std::endl;
- std::cout << " PFO energy " << (*itPFO)->GetEnergy() << std::endl;
+ std::cout << "Pandora PFO momentum " << (*itPFO)->GetMomentum().GetX()<< " " << (*itPFO)->GetMomentum().GetY()<< " " << (*itPFO)->GetMomentum().GetZ() << std::endl;
+ std::cout << "Pandora PFO energy " << (*itPFO)->GetEnergy() << std::endl;
#endif
float momentum[3] = {(*itPFO)->GetMomentum().GetX(), (*itPFO)->GetMomentum().GetY(), (*itPFO)->GetMomentum().GetZ()};
pReconstructedParticle->setMomentum(momentum);
@@ -168,20 +143,20 @@
pReconstructedParticle->setCharge((*itPFO)->GetCharge());
pReconstructedParticle->setType((*itPFO)->GetParticleId());
- //temporary variables to access the track momentum...
- DetectorGeometry* detector = getJobManager()->getDetectorGeometry();
- PandoraApi::Geometry::Parameters* pandoraGeomParams = detector->getGeometryParameters();
- double magneticField = pandoraGeomParams->m_bField.Get();
+ //temporary variables to access the track momentum...
+ DetectorGeometry* detector = getJobManager()->getDetectorGeometry();
+ PandoraApi::Geometry::Parameters* pandoraGeomParams = detector->getGeometryParameters();
+ double magneticField = pandoraGeomParams->m_bField.Get();
#ifdef PFOPROCESSOR_DEBUG
- std::cout << "BField= " << magneticField << std::endl;
+ std::cout << "BField= " << magneticField << std::endl;
#endif
double fieldConversion = 2.99792458e-4;
- double px = 0.;
- double py = 0.;
- double pz = 0.;
- double pT =0.;
- double energy = 0.;
- if(trackAddressList.size()>1) std::cout << " PFO has "<< trackAddressList.size() << std::endl;
+ double px = 0.;
+ double py = 0.;
+ double pz = 0.;
+ double pT = 0.;
+ double energy = 0.;
+ if (trackAddressList.size()>1) std::cout << " PFO has "<< trackAddressList.size() << std::endl;
// Associate the Tracks with the ReconstructedParticles.
for (pandora::TrackAddressList::iterator itTrack = trackAddressList.begin(), itTrackEnd = trackAddressList.end();
itTrack != itTrackEnd;
@@ -190,31 +165,35 @@
#ifdef PFOPROCESSOR_DEBUG
std::cout << "adding track to RP" << std::endl;
#endif
- Track* t = (Track*) (*itTrack);
+ Track* t = (Track*) (*itTrack);
double omega = t->getOmega();
double phi = t->getPhi();
- double tanLambda = t->getTanLambda();
- pT = fabs(1./omega)*magneticField*fieldConversion;
+ double tanLambda = t->getTanLambda();
+ pT = fabs(1./omega)*magneticField*fieldConversion;
px = pT*cos(phi);
- py = pT*sin(phi);
+ py = pT*sin(phi);
pz = pT*tanLambda;
- energy = sqrt(px*px+py*py+pz*pz+(*itPFO)->GetMass()*(*itPFO)->GetMass());
+ energy = sqrt(px*px+py*py+pz*pz+(*itPFO)->GetMass()*(*itPFO)->GetMass());
momentum[0] = px;
- momentum[1] = py;
- momentum[2] = pz;
+ momentum[1] = py;
+ momentum[2] = pz;
+
+#ifdef PFOPROCESSOR_DEBUG
+ std::cout << "track (px, py, pz) : (" << px << ", " << py << ", " << pz << ")" << std::endl;
+#endif
+
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.
- if(trackAddressList.size()!=0)
- {
- pReconstructedParticle->setMomentum(momentum);
- pReconstructedParticle->setEnergy(energy);
- }
+ // 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.
+ if(trackAddressList.size() !=0)
+ {
+ pReconstructedParticle->setMomentum(momentum);
+ pReconstructedParticle->setEnergy(energy);
+ }
// Add the ReconstructedParticle to the collection.
pReconstructedParticleCollection->addElement(pReconstructedParticle);
slicPandora/src
diff -u -r1.13 -r1.14
--- SimCalorimeterHitProcessor.cpp 7 Jun 2010 22:59:48 -0000 1.13
+++ SimCalorimeterHitProcessor.cpp 8 Jun 2010 21:43:02 -0000 1.14
@@ -117,10 +117,10 @@
long long cellId = ((long long)cellId1)<<32 | cellId0;
// Decode the layer number from the id.
- int layer = decoder->getFieldValue("layer", cellId);
+ int layer = decoder->getFieldValue("layer", cellId);
// Get the layer parameters for this layer.
- PandoraApi::GeometryParameters::LayerParameters layerParams = (*layerList)[layer];
+ PandoraApi::GeometryParameters::LayerParameters layerParams = (*layerList)[layer];
// Get the extra layer parameters for this layer (sampling).
DetectorGeometry::ExtraLayerParameters xlayerParams = xsubdet.m_extraLayerParams[layer];
slicPandora/src
diff -u -r1.5 -r1.6
--- SimpleTrackProcessor.cpp 26 Mar 2010 18:52:05 -0000 1.5
+++ SimpleTrackProcessor.cpp 8 Jun 2010 21:43:02 -0000 1.6
@@ -37,8 +37,6 @@
void SimpleTrackProcessor::processEvent(EVENT::LCEvent* event)
{
- //std::cout << "SimpleTrackProcessor::processEvent" << std::endl;
-
LCCollection* trackCollection = event->getCollection(trackCollectionName);
int ntracks = trackCollection->getNumberOfElements();
@@ -62,13 +60,18 @@
if (0. != signedCurvature)
trackParameters.m_chargeSign = static_cast<int>(signedCurvature / std::fabs(signedCurvature));
- // FIXME: Mass hard-coded to charged pion.
+ // FIXME Mass hard-coded to charged pion.
trackParameters.m_mass = 0.13957018;
- // FIXME: Hard-coded DCA momentum parameter.
+ // FIXME Particle Id hard-coded to charged pion.
+#if PANDORA_RELEASE >= 1
+ trackParameters.m_particleId = 211;
+#endif
+
+ // FIXME Hard-coded DCA momentum parameter.
trackParameters.m_momentumAtDca = CartesianVector(0., 0., 0.);
- // FIXME: Next three boolean parameters are hard-coded.
+ // FIXME Next three boolean parameters are hard-coded.
trackParameters.m_reachesECal = true;
trackParameters.m_canFormPfo = true;
trackParameters.m_canFormClusterlessPfo = false;
slicPandora/include
diff -u -r1.3 -r1.4
--- CalorimeterHitProcessor.h 11 Mar 2010 22:18:44 -0000 1.3
+++ CalorimeterHitProcessor.h 8 Jun 2010 21:43:02 -0000 1.4
@@ -65,6 +65,11 @@
* Print the given CalHit::Parameters to cout.
*/
void printCaloHitParameters(const PandoraApi::CaloHit::Parameters&);
+
+private:
+
+ float m_totalEHits;
+
};
#endif
slicPandora/include
diff -u -r1.2 -r1.3
--- PfoConstructionAlgorithm.h 9 Mar 2010 20:13:42 -0000 1.2
+++ PfoConstructionAlgorithm.h 8 Jun 2010 21:43:02 -0000 1.3
@@ -1,10 +1,13 @@
-// $Id: PfoConstructionAlgorithm.h,v 1.2 2010/03/09 20:13:42 jeremy Exp $
+// $Id: PfoConstructionAlgorithm.h,v 1.3 2010/06/08 21:43:02 jeremy Exp $
/**
* @file PandoraPFANew/include/Algorithms/PfoConstructionAlgorithm.h
*
* @brief Header file for the pfo construction algorithm class.
*
* $Log: PfoConstructionAlgorithm.h,v $
+ * Revision 1.3 2010/06/08 21:43:02 jeremy
+ * make compatible with Pandora release1 (set PANDORA_RELEASE macro to enable); add basic code for digital calorimetry
+ *
* Revision 1.2 2010/03/09 20:13:42 jeremy
* checkpoint
*
@@ -17,6 +20,8 @@
#include "Algorithms/Algorithm.h"
+//#include "Algorithms/PfoConstruction/PfoCreationAlgorithm.h"
+
/**
* @brief PfoConstructionAlgorithm class
*/
CVSspam 0.2.8