Commit b69575e8 authored by Luca Mastrolorenzo's avatar Luca Mastrolorenzo

made the dR between C2d of consecutive layers (to form a C3d) a parameter of...

made the dR between C2d of consecutive layers (to form a C3d) a parameter of the code specified by the config file. + Addition of some plots in the AnalysisTrgC3d.hh
parent a68f1707
This diff is collapsed.
......@@ -30,6 +30,17 @@ string hName(char* baseName, int e){
}
string hName(char* baseName, int e, int l){
stringstream name;
name << baseName << e << "_" << l;
//cout << baseName << " " << e << " - " << name.str() << " " << name.str().c_str() << endl;
return name.str();
}
class AnalysisTrgC3d : public AnalysisBase {
......@@ -79,7 +90,23 @@ public:
42, -1.5, 40.5,
1000, 0, 1
);
for(int l=0; l<Geometry::kNumberOfLayers; l++){
name = hName("C2dAvgDistNextLayer_vs_MipT_",e,l);
hhC2dAvgDistNextLayer_vs_MipT[e][l] = new TH2D( name.c_str(),
name.c_str(),
200, -1.5, 1000,
1000, 0, 1
);
name = hName("C2dAvgDistNextLayer_vs_SigMipT_",e,l);
hhC2dAvgDistNextLayer_vs_SigMipT[e][l] = new TH2D( name.c_str(),
name.c_str(),
200, -1.5, 1000,
1000, 0, 1
);
}
/* efficiencies */
name = hName("C3dMipsEff_", e);
hC3dMipsEffC2d[e] = new TH1D( name.c_str(),
......@@ -239,6 +266,8 @@ public:
std::vector<TrgC2d> &vTrgC2dNextL( event.trgC2ds(e, l+1) );
for( std::vector<TrgC2d>::iterator sclu2d = vTrgC2dNextL.begin(); sclu2d != vTrgC2dNextL.end(); sclu2d++ ) {
hhC2dAvgDistNextLayer[e]->Fill(l, sqrt( (clu2d->centerNorm().first-sclu2d->centerNorm().first)*(clu2d->centerNorm().first-sclu2d->centerNorm().first) + (clu2d->centerNorm().second-sclu2d->centerNorm().second)*(clu2d->centerNorm().second-sclu2d->centerNorm().second) ) );
hhC2dAvgDistNextLayer_vs_MipT[e][l]->Fill(sclu2d->transverseMips() , sqrt( (clu2d->centerNorm().first-sclu2d->centerNorm().first)*(clu2d->centerNorm().first-sclu2d->centerNorm().first) + (clu2d->centerNorm().second-sclu2d->centerNorm().second)*(clu2d->centerNorm().second-sclu2d->centerNorm().second) ) );
hhC2dAvgDistNextLayer_vs_SigMipT[e][l]->Fill(sclu2d->simTransverseMips(true) , sqrt( (clu2d->centerNorm().first-sclu2d->centerNorm().first)*(clu2d->centerNorm().first-sclu2d->centerNorm().first) + (clu2d->centerNorm().second-sclu2d->centerNorm().second)*(clu2d->centerNorm().second-sclu2d->centerNorm().second) ) );
}
}
if( clu2d->containsSigEne() )
......@@ -347,19 +376,21 @@ public:
virtual bool select(Event &event) {
for(unsigned e(0);e<Geometry::kNumberOfEndcaps;e++) {
std::vector<Particle> &vPhoton(event.photons(e));
for(unsigned i(0);i<vPhoton.size();i++) {
Particle proj(vPhoton[i].project(Geometry::layerZ(e,0)));
if(fabs(proj.position().eta())>=1.7 &&
fabs(proj.position().eta())< 2.7
) return true;
}
//LucaModif std::vector<Particle> &vSignal(event.photons(e));
std::vector<Particle> &vSignal(event.photons(e));
for(unsigned i(0);i<vSignal.size();i++) {
Particle proj(vSignal[i].project(Geometry::layerZ(e,0)));
if(fabs(proj.position().eta())>=1.7 &&
fabs(proj.position().eta())< 2.7
) return true;
}
}
return false;
}
}
private:
......@@ -372,6 +403,8 @@ private:
TH2D* hhC2dAvgDistLayer[Geometry::kNumberOfEndcaps];
TH2D* hhC2dAvgDistNextLayer[Geometry::kNumberOfEndcaps];
TH2D* hhC2dAvgDistNextLayer_vs_MipT[Geometry::kNumberOfEndcaps][Geometry::kNumberOfLayers];
TH2D* hhC2dAvgDistNextLayer_vs_SigMipT[Geometry::kNumberOfEndcaps][Geometry::kNumberOfLayers];
TH1D* hC3dMipsEffC2d[Geometry::kNumberOfEndcaps];
TH1D* hC3dTmipsEffC2d[Geometry::kNumberOfEndcaps];
......
......@@ -7,7 +7,7 @@ void trgC3dCreator() {
if( Event::fTrgC3dCreatorMethod == 0 ){
for(unsigned e(0);e<Geometry::kNumberOfEndcaps;e++) {
vTrgC3d[e].clear();
vTrgC3d[e].resize(0);
/* SEEDING THE 3D CLUSTERS */
const unsigned layerSeed = 10;
......@@ -28,7 +28,8 @@ void trgC3dCreator() {
TrgC2d *seedTC = vTrgC3d[e].at(iC3d).trgC2ds().at(0);
double dist = seedTC->distEtaPhi( probingTC );
if(dist>0 && dist<0.02){
//if(dist>0 && dist<0.02){
if(dist>0 && dist<fNormCooCut){
vTrgC3d[e][iC3d].addTrgC2d( &(vTrgC2d[e][l].at(iC2d)) );
break;
}
......@@ -44,7 +45,7 @@ void trgC3dCreator() {
for(unsigned e(0);e<Geometry::kNumberOfEndcaps;e++) {
vTrgC3d[e].clear();
vTrgC3d[e].resize(0);
//TH2D* h[5];
TH2D* h[1];
......@@ -106,7 +107,7 @@ void trgC3dCreator() {
for(unsigned e(0);e<Geometry::kNumberOfEndcaps;e++) {
vTrgC3d[e].clear();
vTrgC3d[e].resize(0);
for(unsigned l(0); l<Geometry::kNumberOfLayers; l++) {
......
......@@ -18,6 +18,7 @@ nStage = 0
h_time = 0
SeedCut = -1
EneCut = -1
dRCut = -1
OutDir = ""
mail = ""
......@@ -59,6 +60,9 @@ for iParam in range(0, nInputParams) :
if sys.argv[iParam] == "-EneCut":
iParam = 1+iParam
EneCut = sys.argv[iParam]
if sys.argv[iParam] == "-dRCut":
iParam = 1+iParam
dRCut = sys.argv[iParam]
if sys.argv[iParam] == "-OutDir":
iParam = 1+iParam
OutDir = sys.argv[iParam]
......@@ -77,8 +81,8 @@ if h_time == 0 or fileName == "" :
directoryName = strftime("%Y-%m-%d_%Hh%Mm%Ss_"+fileName+'_Analysis'+nAnalysis, gmtime())
if SeedCut > 0 or EneCut >0 :
directoryName = strftime("%Y-%m-%d_%Hh%Mm%Ss_"+fileName+'_Analysis'+nAnalysis+'_SE_'+SeedCut+'_TCE_'+EneCut, gmtime())
if SeedCut > 0 or EneCut >0 or dRCut > 0 :
directoryName = strftime("%Y-%m-%d_%Hh%Mm%Ss_"+fileName+'_Analysis'+nAnalysis+'_SE_'+SeedCut+'_TCE_'+EneCut+'_dR_'+dRCut, gmtime())
os.makedirs( directoryName )
os.chdir( directoryName )
......@@ -103,7 +107,7 @@ fileReport.write('\n')
fileReport.write( strftime("creation data: %Y-%m-%d GMT: %Hh%Mm%Ss", gmtime() ) )
fileReport.write('\n')
fileReport.write("using the command: \n" )
fileReport.write("./launcherIC.py -g -nj "+nJobs+" -n "+nEventsPerJob+" -a "+nAnalysis+" -f "+fileName+" -p "+nPU+" -s "+nStage+" -h_time "+h_time+" -Delta_t "+Delta_t+" -OutDir "+OutDir+" -mail "+mail )
fileReport.write("./launcherIC.py -g -nj "+nJobs+" -n "+nEventsPerJob+" -a "+nAnalysis+" -f "+fileName+" -p "+nPU+" -s "+nStage+" -h_time "+h_time+" -Delta_t "+Delta_t+" -SeedCut "+SeedCut+" -EneCut "+EneCut+" -dRCut "+dRCut+" -OutDir "+OutDir+" -mail "+mail )
fileReport.write('\n')
fileReport.write('-----------------------------------------------\n')
fileReport.write('-----------------------------------------------\n')
......@@ -114,9 +118,15 @@ fileReport.write( "signal is mixed with PU: "+str( nPU) )
fileReport.write('\n')
fileReport.write( "going through the: "+str( nStage)+' stages of reconstruction' )
fileReport.write('\n')
if SeedCut > 0 or EneCut >0 :
fileReport.write('The clustering algorithm uses a SeedCut = '+str(SeedCut)+' and a EneCut = '+str(EneCut) )
fileReport.write('\n')
if SeedCut > 0 or EneCut > 0 :
if dRCut > 0 :
fileReport.write('The 2D-clustering algorithm uses a SeedCut = '+str(SeedCut)+' and a EneCut = '+str(EneCut) )
fileReport.write('\n')
fileReport.write('The 3D-clustering algorithm uses a DeltaR = '+str(dRCut) )
fileReport.write('\n')
else :
fileReport.write('The 2D-clustering algorithm uses a SeedCut = '+str(SeedCut)+' and a EneCut = '+str(EneCut) )
fileReport.write('\n')
fileReport.write('Output file sub-directory: ../../'+OutDir)
fileReport.write('\n')
fileReport.write('\n')
......@@ -157,7 +167,10 @@ for i_script in range(0, int(nJobs)) :
print "job min = ",job_minEv
print "job max = ",job_maxEv
print "SeedCut",SeedCut
if SeedCut > 0 or EneCut >0 :
print "EneCut",EneCut
print "dRCut",dRCut
if SeedCut > 0 or EneCut > 0 or dRCut > 0 :
fileSh.write('#!/bin/bash \n'
'trap "echo SIGINT seen" SIGINT \n'
'trap "echo SIGUSR1 seen" SIGUSR1 \n'
......@@ -166,7 +179,7 @@ for i_script in range(0, int(nJobs)) :
'trap "echo SIGXCPU seen" SIGXCPU \n'
'cd '+DirAbsPath+' \n'
'source /home/hep/lmastrol/HGCproj_Aug16/HgcTpgSim/env.sh \n'
''+DirAbsPath+'/bin/trgAnalysis.exe -a '+str(nAnalysis)+' -f '+fileName+' -b '+str(job_minEv)+' -n '+str(nEventsPerJob)+' -p '+str(nPU)+' -s '+str(nStage)+' -t '+str(SeedCut)+' -e '+str(EneCut)+' -o '+OutDirName+' \n'
''+DirAbsPath+'/bin/trgAnalysis.exe -a '+str(nAnalysis)+' -f '+fileName+' -b '+str(job_minEv)+' -n '+str(nEventsPerJob)+' -p '+str(nPU)+' -s '+str(nStage)+' -t '+str(SeedCut)+' -e '+str(EneCut)+' -r '+str(dRCut)+' -o '+OutDirName+' \n'
)
fileSh.close()
else :
......
......@@ -67,6 +67,7 @@ public:
nEvt=1000;
EneCut=-1;
SeedCut=-1;
DistanceCut=-1;
outDirName = "";
int ch;
while ((ch = getopt(argc, argv, "a:b:d:f:hj:n:p:s:e:t:o:")) != -1) {
......@@ -105,6 +106,9 @@ public:
case 't':
{std::istringstream sin(optarg); sin >> SeedCut;}
break;
case 'r':
{std::istringstream sin(optarg); sin >> DistanceCut;}
break;
case 'o':
{std::istringstream sin(optarg); sin >> outDirName;}
}
......@@ -166,6 +170,7 @@ public:
std::cout << "jPu = " << jPu << std::endl;
std::cout << "Seed energy = "<< SeedCut << std::endl;
std::cout << "Ene energy = "<< EneCut << std::endl;
std::cout << "Distance cut = "<< DistanceCut << std::endl;
std::cout << ""<< std::endl;
std::cout << "outDirName = " << outDirName <<std::endl;
......@@ -214,6 +219,7 @@ public:
unsigned nDebug;
double EneCut;
double SeedCut;
double DistanceCut;
private:
......@@ -360,8 +366,12 @@ int main(int argc, char *const *argv) {
event->fENERGY_CUT_Et = args.EneCut;
if(args.SeedCut>0)
event->fSEED_ENERGY_CUT_Et = args.SeedCut;
if(args.DistanceCut>0)
event->fNormCooCut = args.DistanceCut;
std::cout << "event->fSEED_ENERGY_CUT_Et " << event->fSEED_ENERGY_CUT_Et << std::endl
<< "event->fENERGY_CUT_Et = fEneCut " << event->fENERGY_CUT_Et << std::endl;
<< "event->fENERGY_CUT_Et " << event->fENERGY_CUT_Et << std::endl
<< "event->fDISTANCE " << event->fNormCooCut << std::endl;
event->setPrintLevel(args.printLevel());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment