-
Notifications
You must be signed in to change notification settings - Fork 15
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
Update get siblings #255
Open
carriganm95
wants to merge
10
commits into
update_CMSSW_13
Choose a base branch
from
updadeGetSiblings
base: update_CMSSW_13
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update get siblings #255
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
af508e8
fix redirector for get siblings
carriganm95 99b3272
updates to get event lists and run crab jobs
carriganm95 6560be4
add option to create json file at time of running
carriganm95 9a9f2e6
Delete DBTools/scripts/createEventLists.py
carriganm95 9fc85ee
bug fix on json name
carriganm95 51b4868
Merge branch 'updadeGetSiblings' of github.com:OSU-CMS/OSUT3Analysis …
carriganm95 ad6b89d
add in user proxy
carriganm95 83883bd
bug fixes
carriganm95 0e14b0d
updates to fiducial maps, also updates to create event lists for AOD/…
carriganm95 72ec5bb
Update submitCreateEventLists.py
carriganm95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/python3 | ||
|
||
import json | ||
import ROOT as r | ||
import numpy as np | ||
import sys | ||
import os | ||
|
||
r.gInterpreter.Declare( | ||
''' | ||
#include "OSUT3Analysis/DBTools/interface/getEvents.h" | ||
|
||
void dummyWrapper(){ | ||
getEvents(); | ||
} | ||
''' | ||
) | ||
r.gSystem.Load('libOSUT3AnalysisDBTools.so') | ||
|
||
if __name__ == "__main__": | ||
|
||
|
||
if not len(sys.argv) >= 3: | ||
print("Error: Need to provide the input json file") | ||
sys.exit(1) | ||
|
||
outputDir = '/data/users/mcarrigan/condor/EventLists/' | ||
if len(sys.argv) >= 4: | ||
outputDir = sys.argv[3] | ||
|
||
f_json = sys.argv[1] | ||
|
||
job = int(sys.argv[2]) | ||
|
||
dataset = f_json.split('/')[-1].split('-')[0] | ||
|
||
outputPath = outputDir + dataset + '/' | ||
|
||
if not os.path.exists(outputPath): | ||
os.mkdir(outputPath) | ||
|
||
with open(f_json) as secondary_fin: | ||
secondary_dict = json.load(secondary_fin) | ||
filename = list(secondary_dict.keys())[job] | ||
|
||
#for filename in secondary_dict.keys(): | ||
if not filename.startswith('root://'): filename = 'root://cmsxrootd.fnal.gov:/' + filename | ||
print("Getting events for", filename) | ||
events = r.getEventsInFile(filename) | ||
events = sorted(events, key=lambda x: (x.runNum, x.lumiBlock, x.event)) | ||
tmpEvents = np.array([str(x.runNum)+':'+str(x.lumiBlock)+':'+str(x.event) for x in events]) | ||
print(tmpEvents, len(tmpEvents)) | ||
fileStr = filename.split('/')[-1] | ||
outputFile = outputPath + fileStr | ||
np.savez(outputFile, eventList=tmpEvents) | ||
print("saved file {} with {} events".format(outputFile, len(tmpEvents))) | ||
#break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/bash | ||
|
||
(>&2 echo "Starting job on " `date`) # Date/time of start of job | ||
(>&2 echo "Running on: `uname -a`") # Condor job is running on this node | ||
(>&2 echo "System software: `cat /etc/redhat-release`") # Operating System on that node | ||
(>&2 echo "Arguments passed to this script are: $@") #print all arguments | ||
|
||
export CMSSW_VERSION_LOCAL=$1 | ||
source /cvmfs/cms.cern.ch/cmsset_default.sh | ||
export SCRAM_ARCH=slc7_amd64_gcc820 | ||
#eval `scramv1 runtime -sh` | ||
|
||
python3 createEventLists.py $2 $3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file the same as the one in
DBTools/scripts/createEventLists.py
? If so, maybe this could be removed? I assume the other one to be the correct file, but correct me if I am wrong.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes good catch there should only be the one in python