Skip to content

Commit

Permalink
Merge pull request #20985 from wmtford/rechitsValidso
Browse files Browse the repository at this point in the history
Stand-alone tracker rechits validation cfg, root macro
  • Loading branch information
cmsbuild committed Oct 25, 2017
2 parents a5eea69 + 98c0334 commit 19a55fa
Show file tree
Hide file tree
Showing 5 changed files with 1,001 additions and 32 deletions.
12 changes: 5 additions & 7 deletions SimTracker/TrackerHitAssociation/test/TestAssoc_Phase0-1_cfg.py
Expand Up @@ -3,9 +3,7 @@
import os

# Create a new CMS process
process = cms.Process('Phase01TrackerRecHitTest')

from Configuration.StandardSequences.Eras import eras # wtf(2)
from Configuration.StandardSequences.Eras import eras
process = cms.Process('assocTest',eras.Run2_2017)

# Import all the necessary files
Expand All @@ -16,7 +14,7 @@
process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
process.load('Configuration.StandardSequences.MagneticField_cff')

process.load('Configuration.EventContent.EventContent_cff') # wtf(5)
process.load('Configuration.EventContent.EventContent_cff')
process.load('SimGeneral.MixingModule.mixNoPU_cfi')
process.load('Configuration.StandardSequences.RawToDigi_cff')
process.load('Configuration.StandardSequences.L1Reco_cff')
Expand Down Expand Up @@ -49,7 +47,7 @@
fileName = cms.string('file:Run2_Trk_rechits_validation.root')
)

process.mix.playback = True # wtf (3)
process.mix.playback = True
process.mix.digitizers = cms.PSet()
for a in process.aliases: delattr(process, a)

Expand Down Expand Up @@ -99,11 +97,11 @@
process.MessageLogger.cerr.FwkReport.reportEvery = 1

# Number of events (-1 = all)
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(5) )
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) )

# Processes to run

process.raw2digi_step = cms.Path(process.RawToDigi) # wtf (3)
process.raw2digi_step = cms.Path(process.RawToDigi)
process.L1Reco_step = cms.Path(process.L1Reco)
process.reconstruction_step = cms.Path(process.reconstruction)

Expand Down
12 changes: 5 additions & 7 deletions SimTracker/TrackerHitAssociation/test/TestAssoc_Phase2_cfg.py
Expand Up @@ -3,9 +3,7 @@
import os

# Create a new CMS process
process = cms.Process('Phase2TrackerRecHitTest')

from Configuration.StandardSequences.Eras import eras # wtf(2)
from Configuration.StandardSequences.Eras import eras
process = cms.Process('assocTest',eras.Phase2)

# Import all the necessary files
Expand All @@ -23,7 +21,7 @@

process.load('Configuration.StandardSequences.MagneticField_cff')

process.load('Configuration.EventContent.EventContent_cff') # wtf(5)
process.load('Configuration.EventContent.EventContent_cff')
process.load('SimGeneral.MixingModule.mixNoPU_cfi')
process.load('Configuration.StandardSequences.RawToDigi_cff')
process.load('Configuration.StandardSequences.L1Reco_cff')
Expand Down Expand Up @@ -56,7 +54,7 @@
fileName = cms.string('file:phase2Trk_rechits_validation.root')
)

process.mix.playback = True # wtf (3)
process.mix.playback = True
process.mix.digitizers = cms.PSet()
for a in process.aliases: delattr(process, a)

Expand Down Expand Up @@ -117,7 +115,7 @@
process.MessageLogger.cerr.FwkReport.reportEvery = 1

# Number of events (-1 = all)
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(20) )
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) )

# Processes to run

Expand All @@ -126,4 +124,4 @@
# process.validation_step = cms.Path(process.content*process.testassociator)
process.validation_step = cms.Path(process.testassociator)

process.schedule = cms.Schedule(process.rechits_step, process.validation_step) # wtf
process.schedule = cms.Schedule(process.rechits_step, process.validation_step)
38 changes: 20 additions & 18 deletions Validation/TrackerRecHits/test/HistoCompare.C
@@ -1,19 +1,24 @@
#include <iostream.h>
#include <iostream> // std::cout
#include <string> // std::string
#include <sstream> // std::stringstream
#include <fstream> // std::filestream
#include "TH1F.h"
#include "TH2.h"
#include "TProfile.h"
#include "TText.h"

class HistoCompare {

public:

HistoCompare() { std::cout << "Initializing HistoCompare... " << std::endl; } ;

void PVCompute(TH1 * oldHisto , TH1 * newHisto , TText * te );
void PVCompute(TH2 * oldHisto , TH2 * newHisto , TText * te );
void PVCompute(TProfile * oldHisto , TProfile * newHisto , TText * te );
void PVCompute(TH1 * oldHisto , TH1 * newHisto , TText * te, const double x=0.6, const double y=0.7);
void PVCompute(TH2 * oldHisto , TH2 * newHisto , TText * te, const double x=0.2, const double y=0.7);
void PVCompute(TProfile * oldHisto , TProfile * newHisto , TText * te, const double x=0.2, const double y=0.7);

private:

Double_t mypv;

TH1 * myoldHisto1;
TH1 * mynewHisto1;

Expand All @@ -27,64 +32,61 @@ class HistoCompare {

};

HistoCompare::PVCompute(TH1 * oldHisto , TH1 * newHisto , TText * te )
void HistoCompare::PVCompute(TH1 * oldHisto , TH1 * newHisto , TText * te, const double x, const double y)
{

myoldHisto1 = oldHisto;
mynewHisto1 = newHisto;
myte = te;

Double_t mypv = myoldHisto1->Chi2Test(mynewHisto1,"UUNORM");
// Double_t mypv = myoldHisto1->Chi2Test(mynewHisto1,"OU");
std::strstream buf;
std::stringstream buf;
std::string value;
buf<<"PV="<<mypv<<std::endl;
buf>>value;

myte->DrawTextNDC(0.2,0.7, value.c_str());
myte->DrawTextNDC(x, y, value.c_str());

std::cout << "[OVAL] " << myoldHisto1->GetName() << " PV = " << mypv << std::endl;
return;

}

HistoCompare::PVCompute(TH2 * oldHisto , TH2 * newHisto , TText * te )
void HistoCompare::PVCompute(TH2 * oldHisto , TH2 * newHisto , TText * te, const double x, const double y)
{

myoldHisto2 = oldHisto;
mynewHisto2 = newHisto;
myte = te;

Double_t mypv = myoldHisto2->Chi2Test(mynewHisto2,"UUNORM");
// Double_t mypv = myoldHisto2->Chi2Test(mynewHisto2,"OU");
std::strstream buf;
std::stringstream buf;
std::string value;
buf<<"PV="<<mypv<<std::endl;
buf>>value;

myte->DrawTextNDC(0.2,0.7, value.c_str());
myte->DrawTextNDC(x, y, value.c_str());

std::cout << "[OVAL] " << myoldHisto2->GetName() << " PV = " << mypv << std::endl;
return;

}


HistoCompare::PVCompute(TProfile * oldHisto , TProfile * newHisto , TText * te )
void HistoCompare::PVCompute(TProfile * oldHisto , TProfile * newHisto , TText * te, const double x, const double y)
{

myoldProfile = oldHisto;
mynewProfile = newHisto;
myte = te;

Double_t mypv = myoldProfile->Chi2Test(mynewProfile,"UUNORM");
// Double_t mypv = myoldProfile->Chi2Test(mynewProfile,"OU");
std::strstream buf;
std::stringstream buf;
std::string value;
buf<<"PV="<<mypv<<std::endl;
buf>>value;

myte->DrawTextNDC(0.2,0.7, value.c_str());
myte->DrawTextNDC(x, y, value.c_str());

std::cout << "[OVAL] " << myoldProfile->GetName() << " PV = " << mypv << std::endl;
return;
Expand Down

0 comments on commit 19a55fa

Please sign in to comment.