Skip to content

Commit

Permalink
Merge pull request cms-sw#5 from gem-sw/CMSSW_6_2_X_SLHC
Browse files Browse the repository at this point in the history
update
  • Loading branch information
Cesare committed Dec 27, 2013
2 parents e5eec2a + 308a75f commit 587a230
Show file tree
Hide file tree
Showing 189 changed files with 29,679 additions and 5,256 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

from Geometry.CMSCommonData.cmsExtendedGeometry2023SHCalXML_cfi import *
from Geometry.TrackerNumberingBuilder.trackerNumberingSLHCGeometry_cfi import *
2 changes: 1 addition & 1 deletion Configuration/PyReleaseValidation/python/relval_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2543,7 +2543,7 @@ def genvalid(fragment,d,suffix='all',fi=''):
'--conditions':'auto:upgradePLS3',
'--mc':'',
'--magField' : '38T_PostLS1',
'--customise' : 'SLHCUpgradeSimulations/Configuration/phase1TkCustoms.customise',
'--customise' : 'SLHCUpgradeSimulations/Configuration/phase2TkCustomsBE5D.customise',
'--geometry' : 'ExtendedPhase2TkBE5D'
}

Expand Down
53 changes: 48 additions & 5 deletions DataFormats/L1TrackTrigger/interface/TTCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class TTCluster
TTCluster();
TTCluster( std::vector< T > aHits,
DetId aDetId,
unsigned int aStackMember );
unsigned int aStackMember,
bool storeLocal );

/// Destructor
~TTCluster();
Expand All @@ -49,6 +50,13 @@ class TTCluster
unsigned int getStackMember() const { return theStackMember; }
void setStackMember( unsigned int aStackMember ) { theStackMember = aStackMember; }

/// Rows and columns to get rid of Digi collection
std::vector< int > findRows() const;
std::vector< int > findCols() const;
void setCoordinates( std::vector< int > a, std::vector< int > b ) { theRows = a; theCols = b; }
std::vector< int > getRows() const { return theRows; }
std::vector< int > getCols() const { return theCols; }

/// Cluster width
unsigned int findWidth() const;

Expand All @@ -66,6 +74,9 @@ class TTCluster
DetId theDetId;
unsigned int theStackMember;

std::vector< int > theRows;
std::vector< int > theCols;

}; /// Close class

/*! \brief Implementation of methods
Expand All @@ -84,18 +95,29 @@ TTCluster< T >::TTCluster()
theHits.clear();
theDetId = 0;
theStackMember = 0;

theRows.clear();
theCols.clear();
}

/// Another Constructor
template< typename T >
TTCluster< T >::TTCluster( std::vector< T > aHits,
DetId aDetId,
unsigned int aStackMember )
unsigned int aStackMember,
bool storeLocal )
{
/// Set data members
this->setHits( aHits );
this->setDetId( aDetId );
this->setStackMember( aStackMember );

theRows.clear();
theCols.clear();
if ( storeLocal )
{
this->setCoordinates( this->findRows(), this->findCols() );
}
}

/// Destructor
Expand All @@ -104,15 +126,36 @@ TTCluster< T >::~TTCluster(){}

/// Cluster width
template< >
unsigned int TTCluster< edm::Ref< edm::DetSetVector<PixelDigi> , PixelDigi > >::findWidth() const;
unsigned int TTCluster< edm::Ref< edm::DetSetVector< PixelDigi >, PixelDigi > >::findWidth() const;

/// Single hit coordinates
/// Average cluster coordinates
template< >
MeasurementPoint TTCluster< edm::Ref< edm::DetSetVector<PixelDigi> , PixelDigi > >::findHitLocalCoordinates( unsigned int hitIdx ) const;
MeasurementPoint TTCluster< edm::Ref< edm::DetSetVector< PixelDigi >, PixelDigi > >::findHitLocalCoordinates( unsigned int hitIdx ) const;

template< >
MeasurementPoint TTCluster< edm::Ref< edm::DetSetVector< PixelDigi >, PixelDigi > >::findAverageLocalCoordinates() const;

/// Operations with coordinates stored locally
template< typename T >
std::vector< int > TTCluster< T >::findRows() const
{
std::vector< int > temp;
return temp;
}

template< typename T >
std::vector< int > TTCluster< T >::findCols() const
{
std::vector< int > temp;
return temp;
}

template< >
std::vector< int > TTCluster< edm::Ref< edm::DetSetVector< PixelDigi >, PixelDigi > >::findRows() const;

template< >
MeasurementPoint TTCluster< edm::Ref< edm::DetSetVector<PixelDigi> , PixelDigi > >::findAverageLocalCoordinates() const;
std::vector< int > TTCluster< edm::Ref< edm::DetSetVector< PixelDigi >, PixelDigi > >::findCols() const;

/// Information
template< typename T >
Expand Down
57 changes: 33 additions & 24 deletions DataFormats/L1TrackTrigger/interface/TTStub.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "DataFormats/GeometryVector/interface/GlobalVector.h"
#include "DataFormats/L1TrackTrigger/interface/TTCluster.h"
#include "DataFormats/Common/interface/DetSetVectorNew.h"

template< typename T >
class TTStub
Expand All @@ -32,9 +33,9 @@ class TTStub
/// Helper methods: findABC( ... )

/// Clusters composing the Stub
std::vector< edm::Ptr< TTCluster< T > > > getClusterPtrs() const { return theClusters; }
const edm::Ptr< TTCluster< T > >& getClusterPtr( unsigned int hitIdentifier ) const;
void addClusterPtr( edm::Ptr< TTCluster< T > > aTTCluster ) { theClusters.push_back( aTTCluster ); }
std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > > getClusterRefs() const { return theClusterRefs; }
const edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > >& getClusterRef( unsigned int hitIdentifier ) const;
void addClusterRef( edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > aTTCluster ) { theClusterRefs.push_back( aTTCluster ); }

/// Detector element
DetId getDetId() const { return theDetId; }
Expand All @@ -57,10 +58,11 @@ class TTStub

private:
/// Data members
DetId theDetId;
std::vector< edm::Ptr< TTCluster< T > > > theClusters;
int theDisplacement;
int theOffset;
DetId theDetId;
std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > >
theClusterRefs;
int theDisplacement;
int theOffset;

}; /// Close class

Expand All @@ -77,7 +79,7 @@ TTStub< T >::TTStub()
{
/// Set default data members
theDetId = 0;
theClusters.clear();
theClusterRefs.clear();
theDisplacement = 999999;
theOffset = 0;
}
Expand All @@ -90,7 +92,7 @@ TTStub< T >::TTStub( DetId aDetId )
this->setDetId( aDetId );

/// Set default data members
theClusters.clear();
theClusterRefs.clear();
theDisplacement = 999999;
theOffset = 0;
}
Expand All @@ -99,14 +101,14 @@ TTStub< T >::TTStub( DetId aDetId )
template< typename T >
TTStub< T >::~TTStub(){}

/// Get the Pointer to a Cluster
/// Get the Reference to a Cluster
template< typename T >
const edm::Ptr< TTCluster< T > >& TTStub< T >::getClusterPtr( unsigned int hitIdentifier ) const
const edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > >& TTStub< T >::getClusterRef( unsigned int hitIdentifier ) const
{
/// Look for the TTCluster with the stack member corresponding to the argument
typename std::vector< edm::Ptr< TTCluster< T > > >::const_iterator clusIter;
for ( clusIter = theClusters.begin();
clusIter != theClusters.end();
typename std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > >::const_iterator clusIter;
for ( clusIter = theClusterRefs.begin();
clusIter != theClusterRefs.end();
++clusIter )
{
if ( (*clusIter)->getStackMember() == hitIdentifier )
Expand All @@ -115,10 +117,10 @@ const edm::Ptr< TTCluster< T > >& TTStub< T >::getClusterPtr( unsigned int hitId
}
}

/// In case no TTCluster is found, return a NULL edm::Ptr
/// In case no TTCluster is found, return a NULL edm::Ref
/// (hopefully code doesn't reach this point)
edm::Ptr< TTCluster< T > >* tmpCluPtr = new edm::Ptr< TTCluster< T > >();
return *tmpCluPtr;
edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > >* tmpCluRef = new edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > >();
return *tmpCluRef;
}

/// Trigger info
Expand All @@ -138,11 +140,17 @@ void TTStub< T >::setTriggerOffset( int anOffset ) { theOffset = anOffset; }
template< typename T >
double TTStub< T >::getTriggerPosition() const
{
return this->getClusterPtr(0)->findAverageLocalCoordinates().x();
return this->getClusterRef(0)->findAverageLocalCoordinates().x();
}

template< typename T >
double TTStub< T >::getTriggerBend() const { return 0.5*( theDisplacement - theOffset ); }
double TTStub< T >::getTriggerBend() const
{
if ( theDisplacement == 999999 )
return theDisplacement;

return 0.5*( theDisplacement - theOffset );
}

/// Information
template< typename T >
Expand All @@ -157,14 +165,15 @@ std::string TTStub< T >::print( unsigned int i ) const
std::stringstream output;
output<<padding<<"TTStub:\n";
padding+='\t';
output << padding << "DetId: " << theDetId.rawId() << '\n';
output << padding << "DetId: " << theDetId.rawId() << ", position: " << this->getTriggerPosition();
output << ", bend: " << this->getTriggerBend() << '\n';
unsigned int iClu = 0;
typename std::vector< edm::Ptr< TTCluster< T > > >::const_iterator clusIter;
for ( clusIter = theClusters.begin();
clusIter!= theClusters.end();
typename std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > >::const_iterator clusIter;
for ( clusIter = theClusterRefs.begin();
clusIter!= theClusterRefs.end();
++clusIter )
{
output << padding << "cluster: " << iClu++ << ", member: " << (*clusIter)->getStackMember();
output << padding << "cluster: " << iClu++ << ", member: " << (*clusIter)->getStackMember() << ", address: " << (*clusIter).get();
output << ", cluster size: " << (*clusIter)->getHits().size() << '\n';
}

Expand Down
Loading

0 comments on commit 587a230

Please sign in to comment.