6 modified files
slicPandora
diff -u -r1.18 -r1.19
--- Makefile 5 Nov 2010 13:11:47 -0000 1.18
+++ Makefile 31 Jan 2011 22:26:42 -0000 1.19
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.18 2010/11/05 13:11:47 jeremy Exp $
+# $Id: Makefile,v 1.19 2011/01/31 22:26:42 stanitzk Exp $
#
# Makefile for the slicPandora project.
@@ -34,10 +34,10 @@
INCDIR=$(PWD)/include
# slicPandora and internal includes
-INCLUDES=-I$(INCDIR) -I$(PANDORAPFA)/include -I$(LCIO)/src/cpp/include
+INCLUDES=-I$(INCDIR) -I$(PANDORAPFA)/Framework/include -I$(PANDORAPFA)/FineGranularityContent/include -I$(LCIO)/src/cpp/include
# external program libraries
-LIBS=-L$(PANDORAPFA)/lib -lPandoraPFANew -L$(LCIO)/lib -llcio -lsio
+LIBS=-L$(PANDORAPFA)/lib -lPandoraFramework -lPandoraFineGranularityContent -lPandoraKMeansContent -L$(LCIO)/lib -llcio -lsio
# compiler flags
CXXFLAGS=-Wall -g $(INCLUDES) -fPIC
@@ -59,7 +59,7 @@
RUNLIBS=$(LIBS) -L$(PWD)/lib -l$(BINNAME)
# compiler flags
-CXXFLAGS=-Wall -g $(INCLUDES)
+CXXFLAGS=-Wall -g $(INCLUDES) -DPOST_CDR_VERSION -DEXTREMELY_UGLY_HACK
# tests
TESTBINS=$(subst tests,bin,$(basename $(TESTSRCS)))
slicPandora/include
diff -u -r1.4 -r1.5
--- PfoConstructionAlgorithm.h 24 Nov 2010 16:44:08 -0000 1.4
+++ PfoConstructionAlgorithm.h 31 Jan 2011 22:26:42 -0000 1.5
@@ -1,10 +1,17 @@
-// $Id: PfoConstructionAlgorithm.h,v 1.4 2010/11/24 16:44:08 speckmay Exp $
+// $Id: PfoConstructionAlgorithm.h,v 1.5 2011/01/31 22:26:42 stanitzk Exp $
/**
* @file PandoraPFANew/include/Algorithms/PfoConstructionAlgorithm.h
*
* @brief Header file for the pfo construction algorithm class.
*
* $Log: PfoConstructionAlgorithm.h,v $
+ * Revision 1.5 2011/01/31 22:26:42 stanitzk
+ *
+ *
+ * Changes to make things work with the latest PandoraVersion
+ * Important, remove Extremely_ugly_hack, once GeomConverter produces XML
+ * compliant to John definition
+ *
* Revision 1.4 2010/11/24 16:44:08 speckmay
* status codes are now in namespace pandora
*
@@ -21,7 +28,7 @@
#ifndef PFO_CONSTRUCTION_ALGORITHM_H
#define PFO_CONSTRUCTION_ALGORITHM_H 1
-#include "Algorithms/Algorithm.h"
+#include "Pandora/Algorithm.h"
//#include "Algorithms/PfoConstruction/PfoCreationAlgorithm.h"
slicPandora/src
diff -u -r1.20 -r1.21
--- DetectorGeometry.cpp 29 Nov 2010 10:29:48 -0000 1.20
+++ DetectorGeometry.cpp 31 Jan 2011 22:26:43 -0000 1.21
@@ -99,7 +99,17 @@
subdet->m_outerZCoordinate = outerZ;
subdet->m_outerPhiCoordinate = outerPhi;
subdet->m_outerSymmetryOrder = outerSym;
-
+
+ // very ugly hack to fix pandora for Christian to test
+ // this is needed because of different Geometry assumptions
+ // 31.01.2011 MS to be fixed
+ #ifdef EXTREMELY_UGLY_HACK
+ if (innerZ<0.0)
+ {
+ subdet->m_innerZCoordinate=0;
+ }
+ #endif
+
// Inner and outer symmetry are different.
if (innerSym != outerSym)
{
@@ -227,7 +237,11 @@
phi += dphi;
}
}
-
+
+ // John says has to be true for both ...
+ subdet->m_isMirroredInZ=true;
+
+
// Setting for digital or analog calorimeter.
std::string isDigital = "false";
calElem->QueryValueAttribute("digital", &isDigital);
slicPandora/src
diff -u -r1.11 -r1.12
--- JobManager.cpp 24 Nov 2010 16:44:08 -0000 1.11
+++ JobManager.cpp 31 Jan 2011 22:26:43 -0000 1.12
@@ -5,10 +5,13 @@
#include "DetectorGeometry.h"
#include "EventProcessor.h"
#include "SimpleBFieldCalculator.h"
-#include "Utilities/HighGranularityPseudoLayerCalculator.h"
+
// pandora
#include "PfoConstructionAlgorithm.h"
+#include "FineGranularityPseudoLayerCalculator.h"
+#include "FineGranularityContent.h"
+
// lcio
#include "IOIMPL/LCFactory.h"
@@ -46,13 +49,15 @@
// Create the slicPandora DetectorGeometry.
PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, createGeometry());
-
// create a new bfield calculator
PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::SetBFieldCalculator(*m_pandora, new SimpleBFieldCalculator()));
-
- // create a new pseudo layer calculator
- PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::SetPseudoLayerCalculator(*m_pandora, new pandora::HighGranularityPseudoLayerCalculator()));
-
+ // create a new pseudo layer calculator using the FineGranularity Library
+ PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::SetPseudoLayerCalculator(*m_pandora, new FineGranularityPseudoLayerCalculator()));
+
+ //register FineGranularity Library
+ PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, FineGranularityContent::RegisterAlgorithms(*m_pandora));
+ PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, FineGranularityContent::RegisterHelperFunctions(*m_pandora));
+
// Create the GeometryParameters within Pandora.
PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Geometry::Create(*m_pandora, *m_detectorGeometry->getGeometryParameters()));
slicPandora/src
diff -u -r1.16 -r1.17
--- PfoProcessor.cpp 24 Nov 2010 16:44:08 -0000 1.16
+++ PfoProcessor.cpp 31 Jan 2011 22:26:43 -0000 1.17
@@ -1,4 +1,4 @@
-// $Id: PfoProcessor.cpp,v 1.16 2010/11/24 16:44:08 speckmay Exp $
+// $Id: PfoProcessor.cpp,v 1.17 2011/01/31 22:26:43 stanitzk Exp $
#include "PfoProcessor.h"
// lcio
@@ -45,8 +45,6 @@
// Make a container for the clusters.
LCCollectionVec* clusterVec = new LCCollectionVec(EVENT::LCIO::CLUSTER);
- // Get the GeometryHelper.
- pandora::GeometryHelper *pGeometryHelper = pandora::GeometryHelper::GetInstance();
// Set flag for pointing back to CalorimeterHits.
LCFlagImpl clusterFlag(0);
@@ -149,10 +147,12 @@
pReconstructedParticle->setType((*itPFO)->GetParticleId());
// Temporary variables to access the track momentum.
- DetectorGeometry* detector = getJobManager()->getDetectorGeometry();
+ // commented out as we don't need these anymore new Pandora version[D
+// DetectorGeometry* detector = getJobManager()->getDetectorGeometry();
// PandoraApi::Geometry::Parameters* pandoraGeomParams = detector->getGeometryParameters();
// double magneticField = pandoraGeomParams->m_bField.Get(CartesianVector(0.f,0.f,0.f));
- double magneticField = pGeometryHelper->GetBField(pandora::CartesianVector(0.f,0.f,0.f));
+// double magneticField = pGeometryHelper->GetBField(pandora::CartesianVector(0.f,0.f,0.f));
+ const float magneticField = pandora::GeometryHelper::GetBField(pandora::CartesianVector(0.f,0.f,0.f));
#ifdef PFOPROCESSOR_DEBUG
std::cout << "BField= " << magneticField << std::endl;
slicPandora/src
diff -u -r1.20 -r1.21
--- SimpleTrackProcessor.cpp 29 Nov 2010 10:29:48 -0000 1.20
+++ SimpleTrackProcessor.cpp 31 Jan 2011 22:26:43 -0000 1.21
@@ -1,4 +1,4 @@
-// $Id: SimpleTrackProcessor.cpp,v 1.20 2010/11/29 10:29:48 speckmay Exp $
+// $Id: SimpleTrackProcessor.cpp,v 1.21 2011/01/31 22:26:43 stanitzk Exp $
//#define POST_CDR_VERSION 1
@@ -75,11 +75,9 @@
navigate = new UTIL::LCRelationNavigator(pMCRelationCollection);
}
- // Get the GeometryHelper.
- pandora::GeometryHelper *pGeometryHelper = pandora::GeometryHelper::GetInstance();
// Get the B field.
- const float magneticField(pGeometryHelper->GetBField(CartesianVector(0.f,0.f,0.f)));
+ const float magneticField(pandora::GeometryHelper::GetBField(CartesianVector(0.f,0.f,0.f)));
// Loop over input tracks.
@@ -118,10 +116,9 @@
trackParameters.m_particleId = -211;
// FIXME: Next three boolean parameters are hard-coded.
- trackParameters.m_reachesECal = true;
+ trackParameters.m_reachesCalorimeter = true;
trackParameters.m_canFormPfo = true;
trackParameters.m_canFormClusterlessPfo = false;
-
#ifdef POST_CDR_VERSION
trackParameters.m_isProjectedToEndCap = false; // FIXME
#endif
@@ -146,7 +143,44 @@
std::cout << " canFormPfo = " << trackParameters.m_canFormPfo.Get() << std::endl;
std::cout << " canFormClusterlessPfo = " << trackParameters.m_canFormClusterlessPfo.Get() << std::endl;
std::cout << " parentAddress = " << trackParameters.m_pParentAddress.Get() << std::endl;
-#endif
+#endif
+
+#ifdef USE_PANDORA_TRACK_EXTRAP
+//experimental code for the timing adapted from the MArlinPandora Code
+
+ pandora::Helix *MyHelix = new pandora::Helix(track->getPhi(), track->getD0(), track->getZ0(), track->getOmega(), track->getTanLambda(), magneticField);
+ const pandora::CartesianVector &referencePoint(MyHelix->GetReferencePoint());
+
+ // First project to endcap
+ float minGenericTime(std::numeric_limits<float>::max());
+ bool isProjectedToEndCap=true;
+ pandora::CartesianVector bestECalProjection;
+
+ (void) MyHelix->GetPointInZ(trackParameters.m_charge.Get()* (pandora::GeometryHelper::GetECalEndCapParameters().GetInnerZCoordinate()), referencePoint, bestECalProjection, minGenericTime);
+ // Cylinder, dealing with cylidners only right now
+ float genericTime(std::numeric_limits<float>::max());
+ pandora::CartesianVector barrelProjection;
+ const pandora::StatusCode statusCode(MyHelix->GetPointOnCircle(pandora::GeometryHelper::GetECalBarrelParameters().GetInnerRCoordinate(), referencePoint, barrelProjection, genericTime));
+
+ if ((pandora::STATUS_CODE_SUCCESS == statusCode) && (genericTime < minGenericTime))
+ {
+ minGenericTime = genericTime;
+ isProjectedToEndCap = false;
+ bestECalProjection = barrelProjection;
+
+ }
+
+ trackParameters.m_isProjectedToEndCap = isProjectedToEndCap;
+
+ // Convert generic time (length from reference point to intersection, divided by momentum) into nanoseconds
+ const float particleMass(trackParameters.m_mass.Get());
+ const float particleEnergy(std::sqrt(particleMass * particleMass + trackParameters.m_momentumAtDca.Get().GetMagnitudeSquared()));
+ trackParameters.m_timeAtCalorimeter = minGenericTime * particleEnergy / 300.f;
+#endif
+
+
+
+
// Register Track parameters with Pandora.
const pandora::Pandora& pandora = getJobManager()->getPandora();
@@ -239,7 +273,7 @@
if(std::isnan(ecalObj->getFloatVal(0)))
{
LCGenericObject* exceptional_endObj = dynamic_cast<LCGenericObject*>(endCollection->getElementAt(i));
- trackParameters.m_trackStateAtECal = pandora::TrackState(exceptional_endObj->getFloatVal(0),
+ trackParameters.m_trackStateAtCalorimeter = pandora::TrackState(exceptional_endObj->getFloatVal(0),
exceptional_endObj->getFloatVal(1),
exceptional_endObj->getFloatVal(2),
exceptional_endObj->getFloatVal(3),
@@ -248,7 +282,7 @@
}
else
{
- trackParameters.m_trackStateAtECal =
+ trackParameters.m_trackStateAtCalorimeter =
pandora::TrackState(ecalObj->getFloatVal(0),
ecalObj->getFloatVal(1),
ecalObj->getFloatVal(2),
@@ -256,7 +290,9 @@
ecalObj->getFloatVal(4),
ecalObj->getFloatVal(5));
}
-
+ // this will set the timing cut to infinity, till we have something better ...
+ trackParameters.m_timeAtCalorimeter = std::numeric_limits<float>::max(); // FIXME Temporarily set to large value to fail any timing cuts
+
// Add end state.
LCGenericObject* endObj = dynamic_cast<LCGenericObject*>(endCollection->getElementAt(i));
trackParameters.m_trackStateAtEnd = pandora::TrackState(endObj->getFloatVal(0),
CVSspam 0.2.8