diff --git a/Control/CalypsoExample/Digitization/scripts/faser_digi_merge.py b/Control/CalypsoExample/Digitization/scripts/faser_digi_merge.py index 2854fd9932e0b6e561020984bac57b8b1f39b86c..a99c51eecdc4a813901085de67d792be40f73cb6 100755 --- a/Control/CalypsoExample/Digitization/scripts/faser_digi_merge.py +++ b/Control/CalypsoExample/Digitization/scripts/faser_digi_merge.py @@ -131,7 +131,7 @@ if len(args.short) > 0: # more files later. --complete overrides this if wanted # Build output filename -if seglo == 0 and (seghi+1) == len(dirlist) and args.complete: # Full run +if args.complete and (seglo == 0) and ((seghi+1) == len(dirlist)): # Full run outfile = f"FaserMC-{short}-{run}" elif seglo == seghi: # Single segment outfile = f"FaserMC-{short}-{run}-{seglo:05}" diff --git a/Control/CalypsoExample/Reconstruction/scripts/submit_faser_reco.sh b/Control/CalypsoExample/Reconstruction/scripts/submit_faser_reco.sh index 5f1ee06615cd822c911cc67d0acc7659662e78dc..f75b144a1bf2d0a725692dbaa82be34ad788cd5c 100755 --- a/Control/CalypsoExample/Reconstruction/scripts/submit_faser_reco.sh +++ b/Control/CalypsoExample/Reconstruction/scripts/submit_faser_reco.sh @@ -11,7 +11,7 @@ # # Monte Carlo options: # --isMC - needed for MC reco -# --digiTag <tag> - override MC reco tag for calo gain (matches digi tag) +# --caloTag <tag> - override MC reco tag for calo gain (to match digi tag) # # file_path - full file name (with path) # release_directory - optional path to release install directory (default pwd) @@ -55,7 +55,7 @@ do ismc=1 shift;; - --digiTag) + --caloTag) echo "Override calo digi tag with $2" gainstr="--MC_calibTag $2" shift; diff --git a/PhysicsAnalysis/NtupleDumper/scripts/faser_ntuple_maker.py b/PhysicsAnalysis/NtupleDumper/scripts/faser_ntuple_maker.py index 5ae87306e068ac7ebfde95f0c29aed5dba283f43..a22d1edbb6802f298044c63e3381d599ce35c978 100755 --- a/PhysicsAnalysis/NtupleDumper/scripts/faser_ntuple_maker.py +++ b/PhysicsAnalysis/NtupleDumper/scripts/faser_ntuple_maker.py @@ -60,7 +60,7 @@ filelist = [] # If this is a directory, need to create file list if filepath.is_dir(): - # Use expected data pattern to find files + # Use expected data pattern to find files (data only) runstr = filepath.stem # Make list of segments to search for @@ -92,7 +92,7 @@ if filepath.is_dir(): for seg in seglist: if args.isMC: - searchstr = f"FaserMC-*-{runstr}-{seg}-*xAOD.root" + searchstr = f"FaserMC-*-{seg}-*xAOD.root" else: searchstr = f"Faser-Physics-{runstr}-{seg}-*xAOD.root" @@ -114,10 +114,12 @@ if filepath.is_dir(): filelist.append(filestr) # End of loop over segments + # Parse name to create outfile firstfile = Path(filelist[0]) firststem = str(firstfile.stem) firstfaser = firststem.split('-')[0] firstshort = firststem.split('-')[1] + runstr = firststem.split('-')[2] firstseg = firststem.split('-')[3] if args.merge > 1: firstseg2 = firststem.split('-')[4] @@ -128,13 +130,21 @@ if filepath.is_dir(): if args.merge > 1: lastseg = laststem.split('-')[4] + print(f"Faser = {firstfaser}") + print(f"Short = {firstshort}") + print(f"Run = {runstr}") + print(f"First = {firstseg}") + print(f"Last = {lastseg}") + print(f"Args = {args.tag}") + # Find any tags tagstr = firststem.replace(f"{firstfaser}-{firstshort}-{runstr}-{firstseg}", "") if args.merge > 1: tagstr = tagstr.replace(f"-{firstseg2}", "") tagstr = tagstr.replace("-xAOD", "") - print(f"Tag = {tagstr}") + + print(f"Tag = {tagstr}") # Build output name outfile = f"{firstfaser}-{firstshort}-{runstr}-{firstseg}-{lastseg}" @@ -148,6 +158,7 @@ if filepath.is_dir(): outfile += "-PHYS.root" + # If this is a single file, just process that # Could be a url, so don't check if this is a file else: diff --git a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx index b61be213ac21f4c7cb568b9bb97177260c266090..e1053fa6f84d9242e6010ba756981f9ccc05d9dd 100644 --- a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx +++ b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx @@ -610,6 +610,7 @@ StatusCode NtupleDumperAlg::execute(const EventContext &ctx) const } // load in calibrated calo container + if (m_doCalib) { SG::ReadHandle<xAOD::CalorimeterHitContainer> ecalCalibratedContainer { m_ecalCalibratedContainer, ctx }; ATH_CHECK(ecalCalibratedContainer.isValid()); for (auto hit : *ecalCalibratedContainer) { @@ -649,6 +650,7 @@ StatusCode NtupleDumperAlg::execute(const EventContext &ctx) const ATH_MSG_DEBUG("Calibrated preshower: ch is " << ch << ", edep is " << hit->E_dep() << ", E_EM is " << hit->E_EM() << ", Nmip is " << hit->Nmip() << ", fit_to_raw_ratio is " << hit->fit_to_raw_ratio()); } + } // process all waveeform data fro all scintillator and calorimeter channels SG::ReadHandle<xAOD::WaveformHitContainer> vetoNuContainer { m_vetoNuContainer, ctx }; @@ -766,8 +768,16 @@ StatusCode NtupleDumperAlg::execute(const EventContext &ctx) const // loop over all reconstructed tracks and use only the tracks that have hits in all three tracking stations (excludes IFT) // store track parameters at most upstream measurement and at most downstream measurement // extrapolate track to all scintillator positions and store extrapolated position and angle - SG::ReadHandle<TrackCollection> trackCollection {m_trackCollectionWithoutIFT, ctx}; // use track collection that excludes IFT + SG::ReadHandle<TrackCollection> trackCollection; + if (m_useIFT) { + SG::ReadHandle<TrackCollection> tc {m_trackCollection, ctx}; // use track collection that excludes IFT + trackCollection = tc; + } else { + SG::ReadHandle<TrackCollection> tc {m_trackCollectionWithoutIFT, ctx}; // use track collection that excludes IFT + trackCollection = tc; + } ATH_CHECK(trackCollection.isValid()); + for (const Trk::Track* track : *trackCollection) { if (track == nullptr) continue; diff --git a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h index 5cc342021993ca07354e6a4924f7e5cfb07ae552..c970480b2586af42fe046144905473aa505cbd35 100644 --- a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h +++ b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h @@ -98,6 +98,8 @@ private: const PreshowerID* m_preshowerHelper; const EcalID* m_ecalHelper; + BooleanProperty m_useIFT { this, "UseIFT", false, "Use IFT tracks" }; + BooleanProperty m_doCalib { this, "DoCalib", true, "Fill calibrated calorimeter quantities" }; BooleanProperty m_doBlinding { this, "DoBlinding", true, "Blinding will not output events with Calo signal > 10 GeV e-" }; BooleanProperty m_useFlukaWeights { this, "UseFlukaWeights", false, "Flag to weight events according to value stored in HepMC::GenEvent" }; BooleanProperty m_useGenieWeights { this, "UseGenieWeights", false, "Flag to weight events according to Genie luminosity" };