Closed gordonwatts closed 3 years ago
List of variables that need to be supported:
Meeting minutes from a detailed discussion of this...
class Event:
@property
def tracks(self) -> Array[Track]
class Track:
@property
def pt(self) -> float
@property
def hitPattern(self) -> HitPattern
class HitPattern:
@property
def nHits(self) -> int
def getHitPattern(self, i: int) -> int
def validHitFilter(self, hp: int) -> bool
func_adl
QueryWant the track pt's of all tracks with more than 5 valid hits (in the hit pattern mask)
Define events
as our source dataset upon which all func_adl
queries run (e.g. ObjectStream
)
Low level func_adl
:
events
.SelectMany(e: e.tracks())
.Where(t: Range(0, t.hitPattern().nHits)
.Select(nth: t.hitPattern().getHitPattern(nth)))
.Where(hp: t.hitPattern.validHitFilter(hp))
.Count() > 5
)
.Select(t: t.pt())
Comments:
array[0]
are supported already, so it should bevisit_Num
Range
specification - def Range(start_index: int, length: int) -> Array[int]
Range
Range
is a standalone function and source of a stream of objects (which happen to be numbers).func_adl
how is Range
defined?
def Range(start_index: int, length: int) -> ObjectStream[int]
from func_adl import Range
before you can use this.for(index = start_index; index < length; index++) {...}
???SelectIndex
events
.SelectMany(e: e.tracks())
.Where(t: SelectIndex(t.hitPattern().nHits, nth: t.hitPattern().getHitPattern(nth))
.Where(hp: t.hitPattern.validHitFilter(hp))
.Count() > 5
)
.Select(t: t.pt())
Comments
SelectIndex
isn't a good name for thisIf we added SelectIndex
:
Range
and Select
by the short cuts file (similar to aggregate).events
.SelectMany(e: e.tracks("Tracks"))
.Where(t: Range(0, t.hitPattern().nHits)
.Select(nth: t.hitPattern().getHitPattern(nth)))
.Where(hp: t.hitPattern().validHitFilter(hp))
.Count() > 5
)
.Select(t: t.pt())
Tracks = iEvent.getByLabel("Tracks")
for(auto *t : Tracks) {
int c =0 ;
int length = t.hitPattern().nHits();
int start_index = 0;
for(int i=start_index; i<length; i++) {
hp = t.hitPattern().getHitPattern(i);
if(t.hitPattern().validHitFilter(hp)) {
c++;
}
}
if(c>5) {
double p = t.pt();
ttree->Fill(p);
}
}
This was done!
The run 1 demo from CMS makes a final Higgs to 4 lepton plot. Looking through that there are a number of variables that are extracted to make the plot and selections that require some more complex type information than is currently supported by the cms run 1 aod extractor.
This issue is to complete the set of variables required for extraction.