forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,238 additions
and
113 deletions.
There are no files selected for viewing
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,48 @@ | ||
# Base class from which the other modules will inherit | ||
|
||
class module: | ||
|
||
def __init__(self): | ||
|
||
self.myTH1 = [] | ||
self.myTH2 = [] | ||
self.myTH3 = [] | ||
|
||
|
||
def run(self,d): | ||
|
||
pass | ||
|
||
def defineSubcollectionFromIndex(self, collection, subcollection, idx, d): | ||
|
||
columns = list(d.GetColumnNames()) | ||
columns.extend(d.GetDefinedColumnNames()) | ||
|
||
main = [c for c in columns if c.startswith(collection)] # columns of the main collection | ||
|
||
subSet = [c.replace(collection,subcollection) for c in main if c.startswith(collection)] # columns of the sub collection | ||
|
||
for i,s in enumerate(subSet): | ||
|
||
d = d.Define(s, '{vec}[{idx}]'.format(vec=main[i], idx=idx)) | ||
|
||
# define new vector length | ||
|
||
d = d.Define("n{}".format(subcollection), "{}".format(1)) | ||
|
||
|
||
return d | ||
|
||
def getTH1(self): | ||
|
||
return self.myTH1 | ||
|
||
def getTH2(self): | ||
|
||
return self.myTH2 | ||
|
||
def getTH3(self): | ||
|
||
return self.myTH3 | ||
|
||
|
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.