Skip to content

Commit

Permalink
Merge pull request #2 from cms-sw/CMSSW_7_5_X
Browse files Browse the repository at this point in the history
PRToFixMess_RPCDigitizerForUpgrade75XPR_v2
  • Loading branch information
pietverwilligen committed Apr 15, 2015
2 parents 9c4f7e8 + 3982ed3 commit 6740e78
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 32 deletions.
12 changes: 6 additions & 6 deletions Alignment/OfflineValidation/macros/PlotAlignmentValidation.C
Expand Up @@ -60,13 +60,13 @@ PlotAlignmentValidation::PlotAlignmentValidation(const char *inputFile,std::stri
//------------------------------------------------------------------------------
PlotAlignmentValidation::~PlotAlignmentValidation()
{
delete sourcelist;

for(std::vector<TkOfflineVariables*>::iterator it = sourceList.begin();
it != sourceList.end(); ++it){
delete (*it);
}

delete sourcelist;
}

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -214,7 +214,7 @@ void PlotAlignmentValidation::plotOutlierModules(const char *outputFileName, std

gStyle->SetOptStat(111111);
gStyle->SetStatY(0.9);
//TList treelist=getTreeList();
//TList* treelist=getTreeList();

TCanvas *c1 = new TCanvas("canv", "canv", 800, 500);
//setCanvasStyle( *c1 );
Expand Down Expand Up @@ -312,21 +312,21 @@ void PlotAlignmentValidation::plotOutlierModules(const char *outputFileName, std
}

//------------------------------------------------------------------------------
TList PlotAlignmentValidation::getTreeList()
TList* PlotAlignmentValidation::getTreeList()
{
TList treeList = new TList();
TList *treeList = new TList();
TFile *first_source = (TFile*)sourcelist->First();
std::cout<<first_source->GetName()<<std::endl;
TDirectoryFile *d=(TDirectoryFile*)first_source->Get( treeBaseDir.c_str() );
treeList.Add( (TTree*)(*d).Get("TkOffVal") );
treeList->Add( (TTree*)(*d).Get("TkOffVal") );

if( moreThanOneSource ==true ){
TFile *nextsource = (TFile*)sourcelist->After( first_source );
while ( nextsource ) {
std::cout<<nextsource->GetName()<<std::endl;
d=(TDirectoryFile*)nextsource->Get("TrackerOfflineValidation");

treeList.Add((TTree*)(*d).Get("TkOffVal"));
treeList->Add((TTree*)(*d).Get("TkOffVal"));

nextsource = (TFile*)sourcelist->After( nextsource );
}
Expand Down
3 changes: 2 additions & 1 deletion Alignment/OfflineValidation/macros/PlotAlignmentValidation.h
Expand Up @@ -72,6 +72,7 @@ TkOfflineVariables::TkOfflineVariables(std::string fileName, std::string baseDir
class PlotAlignmentValidation {
public:
//PlotAlignmentValidation(TString *tmp);
PlotAlignmentValidation() {}
PlotAlignmentValidation(const char *inputFile,std::string fileName="", int lineColor=1, int lineStyle=1);
~PlotAlignmentValidation();
void loadFileList(const char *inputFile, std::string fileName="", int lineColor=2, int lineStyle=1);
Expand All @@ -89,7 +90,7 @@ class PlotAlignmentValidation {
THStack* addHists(const char *selection, const TString &residType = "xPrime", TLegend **myLegend = 0, bool printModuleIds = false);//add hists fulfilling 'selection' on TTree; residType: xPrime,yPrime,xPrimeNorm,yPrimeNorm,x,y,xNorm; if (printModuleIds): cout DetIds

private :
TList getTreeList();
TList* getTreeList();
std::string treeBaseDir;

bool useFit_;
Expand Down
3 changes: 2 additions & 1 deletion Alignment/OfflineValidation/macros/trackSplitPlot.C
Expand Up @@ -9,6 +9,7 @@ Table Of Contents
6. TDR Style
***********************************/

#include <vector>
#include "trackSplitPlot.h"

//===================
Expand Down Expand Up @@ -119,7 +120,7 @@ TCanvas *trackSplitPlot(Int_t nFiles,TString *files,TString *names,TString xvar,
if (type == Profile || type == ScatterPlot || type == Histogram || type == Resolution)
axislimits(nFiles,files,yvar,'y',relative,pull,ymin,ymax);

TString meansrmss[n];
std::vector<TString> meansrmss(n);
Bool_t used[n]; //a file is not "used" if it's MC data and the x variable is run number, or if the filename is blank

for (Int_t i = 0; i < n; i++)
Expand Down
2 changes: 1 addition & 1 deletion CalibTracker/SiStripChannelGain/test/7TeVData/PlotMacro.C
Expand Up @@ -17,7 +17,7 @@


#include<vector>
#include<tdrstyle.C>
#include "tdrstyle.C"

void PlotMacro_Core(string input, string moduleName, string output);
TF1* getLandau(TH1* InputHisto, double* FitResults, double LowRange=50, double HighRange=5400);
Expand Down
2 changes: 1 addition & 1 deletion Calibration/IsolatedParticles/test/CalibTree.C
Expand Up @@ -90,9 +90,9 @@ public :
virtual void Show(Long64_t entry = -1);
bool goodTrack();
void BookHisto(std::string fname);
TFile *fout;

private:
TFile *fout;
TProfile *hprof_ndets;

};
Expand Down
2 changes: 1 addition & 1 deletion RecoParticleFlow/PFClusterTools/test/src/init.C
@@ -1,8 +1,8 @@
{
/*
* A Root macro to initialise testing of the functionality of the PFClusterTools package
*
*/
{
gSystem->Load("libRecoParticleFlowPFClusterTools.so");
std::cout << "Loaded libraries." << std::endl;
using namespace std;
Expand Down
16 changes: 8 additions & 8 deletions RecoParticleFlow/PFClusterTools/test/src/testConversion.C
Expand Up @@ -7,22 +7,22 @@
using namespace pftools;

TFile* testConversion = new TFile("TestConversion.root", "recreate");
testConversion.mkdir("extraction");
testConversion.cd("extraction");
testConversion->mkdir("extraction");
testConversion->cd("extraction");
TTree* tree = new TTree("Extraction", "");
Calibratable* c = new Calibratable();
tree->Branch("Calibratable", "pftools::Calibratable", &c, 32000, 2);

std::cout << "Initialised objects etc.\n";
TRandom2 rand;
TRandom2 rand2;
for (unsigned u(0); u < 1000; ++u) {
double eta, phi, energy, ecalFrac, gaussSamp;

eta = rand.Uniform(0, 1.5);
phi = rand.Uniform(0, 3.14);
energy = rand.Uniform(2, 20);
ecalFrac = rand.Uniform(0, 1.0);
gaussSamp = rand.Gaus(1, 0.3);
eta = rand2.Uniform(0, 1.5);
phi = rand2.Uniform(0, 3.14);
energy = rand2.Uniform(2, 20);
ecalFrac = rand2.Uniform(0, 1.0);
gaussSamp = rand2.Gaus(1, 0.3);
//gaussSamp = 1.0;

c->reset();
Expand Down
2 changes: 1 addition & 1 deletion RecoParticleFlow/PFClusterTools/test/src/testWrappers.C
@@ -1,8 +1,8 @@
{
/*
* A Root macro to initialise testing of the functionality of the PFClusterTools package
*
*/
{
gSystem->Load("libRecoParticleFlowPFClusterTools.so");

TFile f("TestWrappers.root", "recreate");
Expand Down
8 changes: 4 additions & 4 deletions RecoParticleFlow/PFProducer/src/PFAlgo.cc
Expand Up @@ -2253,7 +2253,7 @@ void PFAlgo::processBlock( const reco::PFBlockRef& blockref,
PFClusterRef hoclusterref = elements[iHO].clusterRef();
(*pfCandidates_)[tmpi].addElementInBlock( blockref, iHO);
muonHO = std::min(muonHO_[0]+muonHO_[1],hoclusterref->energy());
(*pfCandidates_)[tmpi].setHcalEnergy(totalHcal-totalHO,muonHcal);
(*pfCandidates_)[tmpi].setHcalEnergy(max(totalHcal-totalHO,0.0),muonHcal);
(*pfCandidates_)[tmpi].setHoEnergy(hoclusterref->energy(),muonHO);
}
// Remove it from the block
Expand Down Expand Up @@ -2742,7 +2742,7 @@ void PFAlgo::processBlock( const reco::PFBlockRef& blockref,
(*pfCandidates_)[tmpi].setHcalEnergy( rawhcalEnergy[iPivot],hcalEnergy[iPivot] );
(*pfCandidates_)[tmpi].setHoEnergy(0., 0.);
} else {
(*pfCandidates_)[tmpi].setHcalEnergy( rawhcalEnergy[iPivot]-totalHO,hcalEnergy[iPivot]*(1.-totalHO/rawhcalEnergy[iPivot]));
(*pfCandidates_)[tmpi].setHcalEnergy( max(rawhcalEnergy[iPivot]-totalHO,0.0),hcalEnergy[iPivot]*(1.-totalHO/rawhcalEnergy[iPivot]));
(*pfCandidates_)[tmpi].setHoEnergy(totalHO, totalHO * hcalEnergy[iPivot]/rawhcalEnergy[iPivot]);
}
(*pfCandidates_)[tmpi].setPs1Energy( 0. );
Expand Down Expand Up @@ -2814,7 +2814,7 @@ void PFAlgo::processBlock( const reco::PFBlockRef& blockref,
chargedHadron.setHcalEnergy( fraction * totalHcal, fraction * totalHcalEnergyCalibrated );
chargedHadron.setHoEnergy( 0., 0. );
} else {
chargedHadron.setHcalEnergy( fraction * (totalHcal-totalHO), fraction * totalHcalEnergyCalibrated * (1.-totalHO/totalHcal) );
chargedHadron.setHcalEnergy( fraction * max(totalHcal-totalHO,0.0), fraction * totalHcalEnergyCalibrated * (1.-totalHO/totalHcal) );
chargedHadron.setHoEnergy( fraction * totalHO, fraction * totalHO * totalHcalEnergyCalibrated / totalHcal );
}
//JB: fixing up (previously omitted) setting of ECAL energy gouzevit
Expand Down Expand Up @@ -3098,7 +3098,7 @@ void PFAlgo::processBlock( const reco::PFBlockRef& blockref,
(*pfCandidates_)[tmpi].setHcalEnergy( totalHcal, calibHcal );
(*pfCandidates_)[tmpi].setHoEnergy(0.,0.);
} else {
(*pfCandidates_)[tmpi].setHcalEnergy( totalHcal-totalHO, calibHcal*(1.-totalHO/totalHcal));
(*pfCandidates_)[tmpi].setHcalEnergy( max(totalHcal-totalHO,0.0), calibHcal*(1.-totalHO/totalHcal));
(*pfCandidates_)[tmpi].setHoEnergy(totalHO,totalHO*calibHcal/totalHcal);
}
(*pfCandidates_)[tmpi].setPs1Energy( 0. );
Expand Down
10 changes: 5 additions & 5 deletions RecoTracker/TrackProducer/test/analyze_tracks.C
Expand Up @@ -7,11 +7,11 @@ TTree * tree = (TTree *) gROOT->FindObject("Events");
TFile outFile("graphsParTest2.root","recreate");
float intervals[] = {0,0.5,1.0,1.5,2.0,2.5};
int bins = 5;
char * ptinterval = "4.99<P_{T}<5.01";
char * etainterval = "|#eta|<2.5";
char * rs = "recoTracks_rsWithMaterialTracks__RsWithMaterial";
char * ctf = "recoTracks_ctfWithMaterialTracks__FinalFits";
char * sim = "SimTracks_SimG4Object__Test";
const char * ptinterval = "4.99<P_{T}<5.01";
const char * etainterval = "|#eta|<2.5";
const char * rs = "recoTracks_rsWithMaterialTracks__RsWithMaterial";
const char * ctf = "recoTracks_ctfWithMaterialTracks__FinalFits";
const char * sim = "SimTracks_SimG4Object__Test";
////////////////////////////////////////
vector<float> tot;
vector<float> ptrmsRS;
Expand Down
Expand Up @@ -75,9 +75,9 @@ struct weightEntryType
}
TString name_;
const TH1* lut_;
TAxis* xAxis_;
const TAxis* xAxis_;
Int_t numBinsX_;
TAxis* yAxis_;
const TAxis* yAxis_;
Int_t numBinsY_;
int variableX_;
int variableY_;
Expand Down
Expand Up @@ -230,7 +230,7 @@ TGraphAsymmErrors* getEfficiency(const TH1* histogram_numerator, const TH1* hist
return 0;
}

TAxis* xAxis = histogram_numerator->GetXaxis();
const TAxis* xAxis = histogram_numerator->GetXaxis();

Int_t nBins = xAxis->GetNbins();
TArrayF x(nBins);
Expand Down

0 comments on commit 6740e78

Please sign in to comment.