Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track trigger np 20140109 win #1979

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -8,7 +8,7 @@
make_debug_file = cms.bool(True),

# Extras for CBC3 chip
partitionsPerRoc = cms.int32(4),
# partitionsPerRoc = cms.int32(4),
CBC3_MaxStubs = cms.uint32(3),
# Double tab2013 table as CBC3 chip uses full width -- this table for 7-ring design
# BarrelCut = cms.vdouble( 0, 5, 5, 6, 9, 11, 14 ), #Use 0 as dummy to have direct access using DetId to the correct element
Expand All @@ -24,17 +24,27 @@
# missing rings are not taken into account in numbering, so everything
# always starts from 1 to N, with increasing r

# Double tab2013 table as CBC3 chip uses full width -- this table for 5-ring design
# Double tab2013 table as CBC3 chip uses full width -- this table for 5-ring design up to 6_2_0_SLHC5
# BarrelCut = cms.vdouble( 0, 5, 5, 6, 9, 11, 13 ), #Use 0 as dummy to have direct access using DetId to the correct element
# EndcapCutSet = cms.VPSet(
# cms.PSet( EndcapCut = cms.vdouble( 0 ) ), #Use 0 as dummy to have direct access using DetId to the correct element
# cms.PSet( EndcapCut = cms.vdouble( 0, 3, 3, 4, 4, 4, 5, 6, 6, 7, 5, 6, 7, 8, 10, 11 ) ), #D1
# cms.PSet( EndcapCut = cms.vdouble( 0, 3, 3, 3, 4, 4, 5, 5, 6, 6, 4, 5, 6, 7, 8, 9 ) ), #D2 ...
# cms.PSet( EndcapCut = cms.vdouble( 0, 3, 3, 4, 4, 4, 4, 5, 5, 4, 4, 6, 6, 7, 8, 9 ) ),
# cms.PSet( EndcapCut = cms.vdouble( 0, 3, 4, 4, 4, 4, 5, 6, 4, 4, 5, 6, 7, 7, 8, 9 ) ),
# cms.PSet( EndcapCut = cms.vdouble( 0, 3, 4, 4, 4, 4, 6, 6, 4, 4, 5, 6, 7, 7, 8, 9 ) ) ),
# missing rings are not taken into account in numbering, so everything
# always starts from 1 to N, with increasing r

# Double tab2013 table as CBC3 chip uses full width -- this table for 5-ring design since 6_2_0_SLHC5
BarrelCut = cms.vdouble( 0, 5, 5, 6, 9, 11, 13 ), #Use 0 as dummy to have direct access using DetId to the correct element
EndcapCutSet = cms.VPSet(
cms.PSet( EndcapCut = cms.vdouble( 0 ) ), #Use 0 as dummy to have direct access using DetId to the correct element
cms.PSet( EndcapCut = cms.vdouble( 0, 3, 3, 4, 4, 4, 5, 6, 6, 7, 5, 6, 7, 8, 10, 11 ) ), #D1
cms.PSet( EndcapCut = cms.vdouble( 0, 3, 3, 3, 4, 4, 5, 5, 6, 6, 4, 5, 6, 7, 8, 9 ) ), #D2 ...
cms.PSet( EndcapCut = cms.vdouble( 0, 3, 3, 4, 4, 4, 4, 5, 5, 4, 4, 6, 6, 7, 8, 9 ) ),
cms.PSet( EndcapCut = cms.vdouble( 0, 3, 4, 4, 4, 4, 5, 6, 4, 4, 5, 6, 7, 7, 8, 9 ) ),
cms.PSet( EndcapCut = cms.vdouble( 0, 3, 4, 4, 4, 4, 6, 6, 4, 4, 5, 6, 7, 7, 8, 9 ) ) ),
# missing rings are not taken into account in numbering, so everything
# always starts from 1 to N, with increasing r
cms.PSet( EndcapCut = cms.vdouble( 0, 4, 4, 4, 4, 5, 5, 5, 6, 7, 9, 6, 7, 8, 9, 10 ) ), #D1
cms.PSet( EndcapCut = cms.vdouble( 0, 3, 4, 4, 4, 4, 5, 5, 5, 6, 8, 5, 6, 7, 8, 9 ) ), #D2 ...
cms.PSet( EndcapCut = cms.vdouble( 0, 3, 4, 4, 4, 4, 4, 5, 5, 5, 7, 8, 5, 6, 7, 8 ) ),
cms.PSet( EndcapCut = cms.vdouble( 0, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 7, 5, 5, 6, 7 ) ),
cms.PSet( EndcapCut = cms.vdouble( 0, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 7, 5, 5, 6 ) ) ),

)

81 changes: 41 additions & 40 deletions L1Trigger/TrackTrigger/plugins/TTStubBuilder.h
Expand Up @@ -245,54 +245,55 @@ void TTStubBuilder< T >::produce( edm::Event& iEvent, const edm::EventSetup& iSe
}
} /// Stub accepted
else
{
tempRejected->push_back( tempTTStub );

} /// Stub rejected
} /// End of nested loop
} /// End of loop over pairs of Clusters

/// If we are working with max no. stub/ROC, then clean the temporary output
/// and store only the selected stubs
if ( moduleStubs.empty() ) /// NOTE: this includes "if ( maxStubs == 0 )"
continue;

/// Loop over ROC's
/// the ROC ID is not important
for ( auto const & is : moduleStubs )
if ( moduleStubs.empty() == false )
{
/// Put the stubs into the output
if ( is.second.size() <= maxStubs )
/// Loop over ROC's
/// the ROC ID is not important
for ( auto const & is : moduleStubs )
{
for ( auto const & ts: is.second )
/// Put the stubs into the output
if ( is.second.size() <= maxStubs )
{
tempInner->push_back( *(ts.getClusterRef(0)) );
tempOuter->push_back( *(ts.getClusterRef(1)) );
tempOutput->push_back( ts );
for ( auto const & ts: is.second )
{
tempInner->push_back( *(ts.getClusterRef(0)) );
tempOuter->push_back( *(ts.getClusterRef(1)) );
tempOutput->push_back( ts );
}
}
}
else
{
/// Sort them and pick up only the first N.
std::vector< std::pair< unsigned int, double > > bendMap;
for ( unsigned int i = 0; i < is.second.size(); ++i )
else
{
bendMap.push_back( std::pair< unsigned int, double >( i, is.second[i].getTriggerBend() ) );
}
std::sort( bendMap.begin(), bendMap.end(), TTStubBuilder< T >::SortStubBendPairs );
/// Sort them and pick up only the first N.
std::vector< std::pair< unsigned int, double > > bendMap;
for ( unsigned int i = 0; i < is.second.size(); ++i )
{
bendMap.push_back( std::pair< unsigned int, double >( i, is.second[i].getTriggerBend() ) );
}
std::sort( bendMap.begin(), bendMap.end(), TTStubBuilder< T >::SortStubBendPairs );

for ( unsigned int i = 0; i < maxStubs; ++i )
{
/// Put the highest momenta (lowest bend) stubs into the event
tempInner->push_back( *(is.second[bendMap[i].first].getClusterRef(0)) );
tempOuter->push_back( *(is.second[bendMap[i].first].getClusterRef(1)) );
tempOutput->push_back( is.second[bendMap[i].first] );
}
for ( unsigned int i = maxStubs; i < is.second.size(); ++i )
{
/// Reject the rest
tempRejected->push_back( is.second[bendMap[i].first] );
for ( unsigned int i = 0; i < maxStubs; ++i )
{
/// Put the highest momenta (lowest bend) stubs into the event
tempInner->push_back( *(is.second[bendMap[i].first].getClusterRef(0)) );
tempOuter->push_back( *(is.second[bendMap[i].first].getClusterRef(1)) );
tempOutput->push_back( is.second[bendMap[i].first] );
}
for ( unsigned int i = maxStubs; i < is.second.size(); ++i )
{
/// Reject the rest
tempRejected->push_back( is.second[bendMap[i].first] );
}
}
}
} /// End of loop over temp output
} /// End of loop over temp output
} /// End store only the selected stubs if max no. stub/ROC is set

/// Create the FastFillers
if ( tempInner->size() > 0 )
Expand Down Expand Up @@ -346,14 +347,14 @@ void TTStubBuilder< T >::produce( edm::Event& iEvent, const edm::EventSetup& iSe
edm::OrphanHandle< edmNew::DetSetVector< TTCluster< T > > > TTClusterAcceptedHandle = iEvent.put( TTClusterDSVForOutput, "ClusterAccepted" );

/// Now, correctly reset the output
typename edmNew::DetSetVector< TTStub< T > >::const_iterator stubIter;
typename edmNew::DetSetVector< TTStub< T > >::const_iterator stubDetIter;

for ( stubIter = TTStubDSVForOutputTemp->begin();
stubIter != TTStubDSVForOutputTemp->end();
++stubIter )
for ( stubDetIter = TTStubDSVForOutputTemp->begin();
stubDetIter != TTStubDSVForOutputTemp->end();
++stubDetIter )
{
/// Get the DetId and prepare the FastFiller
DetId thisStackedDetId = stubIter->id();
DetId thisStackedDetId = stubDetIter->id();
typename edmNew::DetSetVector< TTStub< T > >::FastFiller acceptedOutputFiller( *TTStubDSVForOutputAccepted, thisStackedDetId );

/// Get its DetUnit
Expand Down
10 changes: 5 additions & 5 deletions L1Trigger/TrackTrigger/python/TTStubAlgorithmRegister_cfi.py
Expand Up @@ -44,11 +44,11 @@
BarrelCut = cms.vdouble( 0, 2.5, 2.5, 3.0, 4.5, 5.5, 6.5 ), #Use 0 as dummy to have direct access using DetId to the correct element
EndcapCutSet = cms.VPSet(
cms.PSet( EndcapCut = cms.vdouble( 0 ) ), #Use 0 as dummy to have direct access using DetId to the correct element
cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 1.5, 2.0, 2.0, 2.0, 2.5, 3.0, 3.0, 3.5, 2.5, 3.0, 3.5, 4.0, 5.0, 5.5 ) ), #D1
cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 1.5, 1.5, 2.0, 2.0, 2.5, 2.5, 3.0, 3.0, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5 ) ), #D2 ...
cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 1.5, 2.0, 2.0, 2.0, 2.0, 2.5, 2.5, 2.0, 2.0, 3.0, 3.0, 3.5, 4.0, 4.5 ) ),
cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 2.0, 2.0, 2.0, 2.0, 2.5, 3.0, 2.0, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0 ) ),
cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 2.0, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0 ) ), # missing rings are not taken into account in numbering, so everything
cms.PSet( EndcapCut = cms.vdouble( 0, 2.0, 2.0, 2.0, 2.0, 2.5, 2.5, 2.5, 3.0, 3.5, 4.5, 3.0, 3.5, 4.0, 4.5, 5.0 ) ), #D1
cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 2.0, 2.0, 2.0, 2.0, 2.5, 2.5, 2.5, 3.0, 4.0, 2.5, 3.0, 3.5, 4.0, 4.5 ) ), #D2 ...
cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 2.0, 2.0, 2.0, 2.0, 2.0, 2.5, 2.5, 2.5, 3.5, 4.0, 2.5, 3.0, 3.5, 4.0 ) ),
cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 1.5, 1.5, 2.0, 2.0, 2.0, 2.0, 2.5, 2.5, 3.0, 3.5, 2.5, 2.5, 3.0, 3.5 ) ),
cms.PSet( EndcapCut = cms.vdouble( 0, 1.5, 1.5, 1.5, 1.5, 1.5, 2.0, 2.0, 2.0, 2.5, 2.5, 3.0, 3.5, 2.5, 2.5, 3.0 ) ), # missing rings are not taken into account in numbering, so everything
# always starts from 1 to N, with increasing r
)
)
Expand Down
10 changes: 5 additions & 5 deletions L1Trigger/TrackTrigger/test/AnalyzerClusterStub.cc
Expand Up @@ -639,18 +639,18 @@ void AnalyzerClusterStub::analyze(const edm::Event& iEvent, const edm::EventSetu

/// Track Trigger
edm::Handle< edmNew::DetSetVector< TTCluster< Ref_PixelDigi_ > > > PixelDigiTTClusterHandle;
edm::Handle< edmNew::DetSetVector< TTCluster< Ref_PixelDigi_ > > > PixelDigiTTClusterInclusiveHandle;
edm::Handle< edmNew::DetSetVector< TTStub< Ref_PixelDigi_ > > > PixelDigiTTStubHandle;
/// NOTE: the InputTag for the "Accepted" clusters is different from the "Inclusive" one
iEvent.getByLabel( "TTStubsFromPixelDigis", "ClusterAccepted", PixelDigiTTClusterHandle );
iEvent.getByLabel( "TTClustersFromPixelDigis", "ClusterInclusive", PixelDigiTTClusterInclusiveHandle );
/// "TTClustersFromPixelDigis", "ClusterInclusive" BUT ...
/// ... "TTStubsFromPixelDigis", "ClusterAccepted"
iEvent.getByLabel( "TTClustersFromPixelDigis", "ClusterInclusive", PixelDigiTTClusterHandle );
iEvent.getByLabel( "TTStubsFromPixelDigis", "StubAccepted", PixelDigiTTStubHandle );

/// Track Trigger MC Truth
edm::Handle< TTClusterAssociationMap< Ref_PixelDigi_ > > MCTruthTTClusterHandle;
edm::Handle< TTStubAssociationMap< Ref_PixelDigi_ > > MCTruthTTStubHandle;
iEvent.getByLabel( "TTClusterAssociatorFromPixelDigis", "ClusterAccepted", MCTruthTTClusterHandle );
iEvent.getByLabel( "TTStubAssociatorFromPixelDigis", "StubAccepted", MCTruthTTStubHandle );
iEvent.getByLabel( "TTClusterAssociatorFromPixelDigis", "ClusterInclusive", MCTruthTTClusterHandle );
iEvent.getByLabel( "TTStubAssociatorFromPixelDigis", "StubAccepted", MCTruthTTStubHandle );

////////////////////////////////
/// COLLECT STUB INFORMATION ///
Expand Down